|
12 | 12 | from osbot_utils.type_safe.primitives.domains.identifiers.safe_str.Safe_Str__Id import Safe_Str__Id |
13 | 13 | from osbot_utils.type_safe.type_safe_core.collections.Type_Safe__Dict import Type_Safe__Dict |
14 | 14 | from osbot_utils.type_safe.type_safe_core.collections.Type_Safe__List import Type_Safe__List |
| 15 | +from osbot_utils.utils.Env import not_in_github_action |
15 | 16 | from osbot_utils.utils.Objects import base_classes |
16 | 17 | from osbot_utils.type_safe.primitives.domains.identifiers.Safe_Id import Safe_Id |
17 | 18 | from osbot_utils.type_safe.Type_Safe import Type_Safe |
@@ -415,18 +416,20 @@ class Container(Type_Safe): |
415 | 416 | # "},\n + }") # BUG |
416 | 417 | assert container.json() == {'nested': {'key': {Status.ACTIVE: 100}}} # this works due to auto conversion of enum into it's string value |
417 | 418 | assert container.json() == {'nested': {'key': {'active': 100}}} # FIXED: this is what we wanted to happen |
418 | | - error_message = ("assert {'nested': {'key': {'active': 100}}} == {}\n \n " |
419 | | - "Left contains 1 more item:\n " |
420 | | - "{'nested': {'key': {'active': 100}}}\n \n " # FIXED: now we get the 'active' string (instead of the Enum representation) |
421 | | - "Full diff:\n - {}\n + {\n + 'nested': " |
422 | | - "{\n + 'key': {\n + " |
423 | | - "'active': 100,\n + },\n + },\n + }") |
424 | | - with pytest.raises(AssertionError, match=re.escape(error_message)): |
425 | | - assert container.json() == {} # FIXED this is the error message we should get |
426 | | - |
427 | | - error_message_2 = 'assert __(nested=__(key=__(active=100))) == __()\n ' |
428 | | - with pytest.raises(AssertionError, match=re.escape(error_message_2)): |
429 | | - assert container.obj() == __() |
| 419 | + |
| 420 | + if not_in_github_action(): # GH actions has different spacing |
| 421 | + error_message = ("assert {'nested': {'key': {'active': 100}}} == {}\n \n " |
| 422 | + "Left contains 1 more item:\n " |
| 423 | + "{'nested': {'key': {'active': 100}}}\n \n " # FIXED: now we get the 'active' string (instead of the Enum representation) |
| 424 | + "Full diff:\n - {}\n + {\n + 'nested': " |
| 425 | + "{\n + 'key': {\n + " |
| 426 | + "'active': 100,\n + },\n + },\n + }") |
| 427 | + with pytest.raises(AssertionError, match=re.escape(error_message)): |
| 428 | + assert container.json() == {} # FIXED this is the error message we should get |
| 429 | + |
| 430 | + error_message_2 = 'assert __(nested=__(key=__(active=100))) == __()\n ' |
| 431 | + with pytest.raises(AssertionError, match=re.escape(error_message_2)): |
| 432 | + assert container.obj() == __() |
430 | 433 |
|
431 | 434 | # couple more edge cases tests |
432 | 435 | json_str = json.dumps(container.json()) |
|
0 commit comments