Repository: SETI/rms-cspyce (language: python)

Issue:
Add current sets of cspyce unit tests and kernel context manager for nightly runs.
Tests that do not pass due to unresolved bugs are set to 'fail_'. The test file 'test_d.py' is not complete and will get more additions. 


Discussion / hints:
## [Codecov](https://app.codecov.io/gh/SETI/pds-cspyce/pull/42?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI) Report
> Merging [#42](https://app.codecov.io/gh/SETI/pds-cspyce/pull/42?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI) (343a010) into [master](https://app.codecov.io/gh/SETI/pds-cspyce/commit/04241c2ce8c95e29bb3ca21e0571e274f383ccd7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI) (04241c2) will **decrease** coverage by `0.59%`.
> The diff coverage is `69.54%`.

```diff
@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
- Coverage   73.25%   72.66%   -0.59%     
==========================================
  Files          15       18       +3     
  Lines        3608     4731    +1123     
  Branches      381      402      +21     
==========================================
+ Hits         2643     3438     +795     
- Misses        926     1252     +326     
- Partials       39       41       +2     
```


| [Impacted Files](https://app.codecov.io/gh/SETI/pds-cspyce/pull/42?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI) | Coverage Δ | |
|---|---|---|
| [unittests/test\_a\_c.py](https://app.codecov.io/gh/SETI/pds-cspyce/pull/42?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI#diff-dW5pdHRlc3RzL3Rlc3RfYV9jLnB5) | `67.53% <67.53%> (ø)` | |
| [unittests/test\_d.py](https://app.codecov.io/gh/SETI/pds-cspyce/pull/42?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI#diff-dW5pdHRlc3RzL3Rlc3RfZC5weQ==) | `68.20% <68.20%> (ø)` | |
| [unittests/gettestkernels.py](https://app.codecov.io/gh/SETI/pds-cspyce/pull/42?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI#diff-dW5pdHRlc3RzL2dldHRlc3RrZXJuZWxzLnB5) | `80.25% <80.25%> (ø)` | |

... and [1 file with indirect coverage changes](https://app.codecov.io/gh/SETI/pds-cspyce/pull/42/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=SETI)



Fix patch:
diff --git a/swig/cspyce0_part2.i b/swig/cspyce0_part2.i
index 4900b3e3..9390ea76 100644
--- a/swig/cspyce0_part2.i
+++ b/swig/cspyce0_part2.i
@@ -3092,7 +3092,7 @@ VECTORIZE_dX_3d__dM_dN_b(dnearp, dnearp_c, 6, 2)
 
 %rename (dp2hx) my_dp2hx_c;
 %apply (void RETURN_VOID) {void my_dp2hx_c};
-%apply (SpiceChar OUT_STRING[ANY]) {SpiceChar hxstr[TIMELEN]};
+%apply (SpiceChar OUT_STRING[ANY]) {SpiceChar hxstr[256]};
 
 %inline %{
     void my_dp2hx_c(


Test patch:
diff --git a/unittests/test_d.py b/unittests/test_d.py
index c7816a8d..96965801 100644
--- a/unittests/test_d.py
+++ b/unittests/test_d.py
@@ -567,8 +567,13 @@ def fail_dasudi_dasrdi():
     assert rdata == pytest.approx(data)
     cs.dascls(handle)
     cleanup_kernel(daspath)
-    
-    
+
+def test_dp2hx():
+    assert cs.dp2hx(2.0e-9) == "89705F4136B4A8^-7"
+    assert cs.dp2hx(1.0) == "1^1"
+    assert cs.dp2hx(-1.0) == "-1^1"
+    assert cs.dp2hx(1024.0) == "4^3"
+
 # Fails due to bytearray reliance.
 def test_dasudc():
     pass