edq-utils 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of edq-utils might be problematic. Click here for more details.

edq/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
  General Python tools used by several EduLinq projects.
3
3
  """
4
4
 
5
- __version__ = '0.1.1'
5
+ __version__ = '0.1.2'
edq/testing/cli.py CHANGED
@@ -35,6 +35,7 @@ import edq.util.json
35
35
  import edq.util.pyimport
36
36
 
37
37
  TEST_CASE_SEP: str = '---'
38
+ OUTPUT_SEP: str = '+++'
38
39
  DATA_DIR_ID: str = '__DATA_DIR__'
39
40
  ABS_DATA_DIR_ID: str = '__ABS_DATA_DIR__'
40
41
  TEMP_DIR_ID: str = '__TEMP_DIR__'
@@ -149,7 +150,7 @@ class CLITestInfo:
149
150
  """
150
151
  Split stdout and stderr into different strings for testing.
151
152
  By default, these two will be combined.
152
- If both are non-empty, then they will be joined like: f"{stdout}\n{TEST_CASE_SEP}\n{stderr}".
153
+ If both are non-empty, then they will be joined like: f"{stdout}\n{OUTPUT_SEP}\n{stderr}".
153
154
  Otherwise, only the non-empty one will be present with no separator.
154
155
  Any stdout assertions will be applied to the combined text.
155
156
  """
@@ -293,7 +294,7 @@ def _get_test_method(test_name: str, path: str, data_dir: str) -> typing.Callabl
293
294
 
294
295
  if (not test_info.split_stdout_stderr):
295
296
  if ((len(stdout_text) > 0) and (len(stderr_text) > 0)):
296
- stdout_text = f"{stdout_text}\n{TEST_CASE_SEP}\n{stderr_text}"
297
+ stdout_text = f"{stdout_text}\n{OUTPUT_SEP}\n{stderr_text}"
297
298
  elif (len(stderr_text) > 0):
298
299
  stdout_text = stderr_text
299
300
 
@@ -0,0 +1,9 @@
1
+ {
2
+ "cli": "edq.cli.version",
3
+ "arguments": [
4
+ '--help'
5
+ ],
6
+ "error": true
7
+ }
8
+ ---
9
+ builtins.SystemExit: 0
edq/testing/unittest.py CHANGED
@@ -14,6 +14,20 @@ class BaseTest(unittest.TestCase):
14
14
  maxDiff = None
15
15
  """ Don't limit the size of diffs. """
16
16
 
17
+ def assertJSONEqual(self, a: typing.Any, b: typing.Any, message: typing.Union[str, None] = None) -> None: # pylint: disable=invalid-name
18
+ """
19
+ Like unittest.TestCase.assertEqual(),
20
+ but uses a default assertion message containing the full JSON representation of the arguments.
21
+ """
22
+
23
+ a_json = edq.util.json.dumps(a, indent = 4)
24
+ b_json = edq.util.json.dumps(b, indent = 4)
25
+
26
+ if (message is None):
27
+ message = FORMAT_STR % (a_json, b_json)
28
+
29
+ super().assertEqual(a, b, msg = message)
30
+
17
31
  def assertJSONDictEqual(self, a: typing.Any, b: typing.Any, message: typing.Union[str, None] = None) -> None: # pylint: disable=invalid-name
18
32
  """
19
33
  Like unittest.TestCase.assertDictEqual(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edq-utils
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Common utilities used by EduLinq Python projects.
5
5
  Author-email: Eriq Augustine <eriq@edulinq.org>
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- edq/__init__.py,sha256=-CVBH7VCV7PXBZTWcJhNoXG1tmu5a5sUUNWZXtZGlbg,86
1
+ edq/__init__.py,sha256=VAgZ9kvZ2qpXBYL-SEmjPCrwVnAvgGTObRn8sfZjbvw,86
2
2
  edq/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  edq/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  edq/cli/version.py,sha256=SxarRVD_AVA-nD4pLVMe6ZjSJpMr7h_r3DgYYs42vjE,591
@@ -21,16 +21,17 @@ edq/procedure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  edq/procedure/verify_exchanges.py,sha256=Bv-wscTaSx5bbQfD6tZutCtG_pyHuFIBhk_RB5ZMJEQ,2765
22
22
  edq/testing/__init__.py,sha256=IKd3fPU_8d_jP19HxG-zKwxFwn7nqFGGtXOY5slY41c,32
23
23
  edq/testing/asserts.py,sha256=BxWTH9aQFwmzb0tf5hx3V4aeJzmiBOO-QajaMM6zklI,2523
24
- edq/testing/cli.py,sha256=L3ar6Q6ZQ5ZTH9TFpMIen4tRXjSwYJlBVEL9WQXc_lU,12898
24
+ edq/testing/cli.py,sha256=Pzb1-6nrC6kYRBTI4R-pCfwDQ7reQUzH68xLn2ZSdME,12916
25
25
  edq/testing/cli_test.py,sha256=IqzdK1fEit_3HagSU-nNI4EjkoQp6-I88JGZ1_x_uQk,525
26
26
  edq/testing/httpserver.py,sha256=r2xSFkHTEzO92vW9XV5g43kC3vOcyQD-RVedXke1IZI,20311
27
27
  edq/testing/httpserver_test.py,sha256=tjBgBbKTHeqE1ugHyao4HpW7FNPTkBGpWK3vuqJgNQg,12123
28
28
  edq/testing/run.py,sha256=Axv0t6yZRUS39xmf5PWR5b54Rg21Nz0ip8G4UyJm1Ik,4814
29
- edq/testing/unittest.py,sha256=ynVZSA0y9lYPrUqj38rgH_AvwHDF0nRF2VCe2JUP9_4,2426
29
+ edq/testing/unittest.py,sha256=7-5ScxXpMBvhhyCvRMPiiUbdfx9FcpMgU6M5A3oHV7c,2980
30
30
  edq/testing/testdata/cli/data/configs/empty/edq-config.json,sha256=yj0WO6sFU4GCciYUBWjzvvfqrBh869doeOC2Pp5EI1Y,3
31
31
  edq/testing/testdata/cli/data/configs/simple-1/edq-config.json,sha256=uQdt7o7VNjOSQk8ni6UrqZ95QkJTUgHcwaL2TvY30bs,42
32
32
  edq/testing/testdata/cli/data/configs/simple-2/edq-config.json,sha256=F3vP5hF1G7rPp2PPUgHemvgA-2AuxTC6Pah8Yr-fRmw,37
33
33
  edq/testing/testdata/cli/data/configs/value-number/edq-config.json,sha256=UrB_6Pa_JRZN3NzuM0OugxQgPizUC5RMqP5xv06cuvg,20
34
+ edq/testing/testdata/cli/tests/help_base.txt,sha256=7FWdcKFpICb8lfz-Zj_b8izzGK5ri0FqH0FJrTn5jss,122
34
35
  edq/testing/testdata/cli/tests/platform_skip.txt,sha256=J6n7v3LhfTyjR3Ejo-uR-g6Xdxx34Fu_cmyGSii_elc,103
35
36
  edq/testing/testdata/cli/tests/version_base.txt,sha256=5e9oSQaivA-0Th7wXpNRhACluyDwvFTL_1xfAkS2Pko,69
36
37
  edq/testing/testdata/cli/tests/config/list/config_list_base.txt,sha256=jtHqRPxM-uJfMkmnZaSDilsxMF7y6UXw-iEtHe8XCuw,495
@@ -71,8 +72,8 @@ edq/util/pyimport_test.py,sha256=Xno0MIa3yMTfBfoTgjKCIMpr1ZShU6bvo9rBRdecXQU,420
71
72
  edq/util/reflection.py,sha256=jPcW6h0fwSDYh04O5rUxlgoF7HK6fVQ2mq7DD9qPrEg,972
72
73
  edq/util/time.py,sha256=anoNM_KniARLombv2BnsoHuCzDqMKiDdIzV7RUe2ZOk,2648
73
74
  edq/util/time_test.py,sha256=iQZwzVTVQQ4TdXrLb9MUMCYlKrIe8qyF-hiC9YLTaMo,4610
74
- edq_utils-0.1.1.dist-info/licenses/LICENSE,sha256=MS4iYEl4rOxMoprZuc86iYVoyk4YgaVoMt7WmGvVF8w,1064
75
- edq_utils-0.1.1.dist-info/METADATA,sha256=jffvIETCgjGJZTf-5VmvuCCfFdaqk1w8fVObY29E0wA,7535
76
- edq_utils-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
- edq_utils-0.1.1.dist-info/top_level.txt,sha256=znBHSj6tgXtcMKrUVtovLli5fIEJCb7d-BMxTLRK4zk,4
78
- edq_utils-0.1.1.dist-info/RECORD,,
75
+ edq_utils-0.1.2.dist-info/licenses/LICENSE,sha256=MS4iYEl4rOxMoprZuc86iYVoyk4YgaVoMt7WmGvVF8w,1064
76
+ edq_utils-0.1.2.dist-info/METADATA,sha256=D8tZ8ZU7TXBQ6FEmam6zvCerJlc9Gsoj-_4pANJGRlc,7535
77
+ edq_utils-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
78
+ edq_utils-0.1.2.dist-info/top_level.txt,sha256=znBHSj6tgXtcMKrUVtovLli5fIEJCb7d-BMxTLRK4zk,4
79
+ edq_utils-0.1.2.dist-info/RECORD,,