Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Feb 8, 2025
1 parent 13d3cd2 commit 045fdb7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion openc3-node/Dockerfile-ubi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG OPENC3_TAG=latest

FROM ${OPENC3_REGISTRY}/${OPENC3_NAMESPACE}/openc3-ruby-ubi:${OPENC3_TAG}

ENV NODEJS_VERSION=18
ENV NODEJS_VERSION=20

ARG NPM_URL=https://registry.npmjs.org

Expand Down
16 changes: 8 additions & 8 deletions openc3/python/openc3/script/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,32 @@ def plans(self):

# Add a group to the suite
def add_group(self, group_class):
if not isinstance(group_class, Group):
raise RuntimeError("add_group must be a Group not a string in Python")
if not issubclass(group_class, Group):
raise RuntimeError(f"add_group received with {group_class}({group_class.__class__}) but must subclass Group")
if not self.scripts().get(group_class, None):
self.scripts()[group_class] = group_class()
self.plans().append(["GROUP", group_class, None])

# Add a script to the suite
def add_script(self, group_class, script):
if not isinstance(group_class, Group):
raise RuntimeError("add_script first param must be a Group not a string in Python")
if not issubclass(group_class, Group):
raise RuntimeError(f"add_script received with {group_class}({group_class.__class__}) but must subclass Group")
if not self.scripts().get(group_class, None):
self.scripts()[group_class] = group_class()
self.plans().append(["SCRIPT", group_class, script])

# Add a group setup to the suite
def add_group_setup(self, group_class):
if not isinstance(group_class, Group):
raise RuntimeError("add_script must be a Group not a string in Python")
if not issubclass(group_class, Group):
raise RuntimeError(f"add_group_setup received with {group_class}({group_class.__class__}) but must subclass Group")
if not self.scripts().get(group_class, None):
self.scripts()[group_class] = group_class()
self.plans().append(["GROUP_SETUP", group_class, None])

# Add a group teardown to the suite
def add_group_teardown(self, group_class):
if not isinstance(group_class, Group):
raise RuntimeError("add_script must be a Group not a string in Python")
if not issubclass(group_class, Group):
raise RuntimeError(f"add_group_teardown received with {group_class}({group_class.__class__}) but must subclass Group")
if not self.scripts().get(group_class, None):
self.scripts()[group_class] = group_class()
self.plans().append(["GROUP_TEARDOWN", group_class, None])
Expand Down
2 changes: 1 addition & 1 deletion openc3/python/test/packets/parsers/test_state_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def test_allows_hazardous_and_an_optional_description(self):
tf.write(' STATE WORST 3 HAZARDOUS "Hazardous description"\n')
tf.seek(0)
self.pc.process_file(tf.name, "TGT1")
self.pc.commands["TGT1"]["PKT1"].buffer = "\x01"
self.pc.commands["TGT1"]["PKT1"].buffer = b"\x01"
self.pc.commands["TGT1"]["PKT1"].check_limits
self.assertIsNone(
self.pc.commands["TGT1"]["PKT1"].items["ITEM1"].hazardous.get("GOOD")
Expand Down
2 changes: 1 addition & 1 deletion openc3/python/test/packets/test_packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def test_prevents_the_read_conversion_cache_from_being_corrupted(self):
value += " more things"
self.assertEqual(self.p.read_item(i, "WITH_UNITS"), "A str with units")

self.p.buffer = "\x00"
self.p.buffer = b"\x00"
i.read_conversion = GenericConversion("['A', 'B', 'C']")
value = self.p.read_item(i, "CONVERTED")
self.assertEqual(value, ["A", "B", "C"])
Expand Down

0 comments on commit 045fdb7

Please sign in to comment.