def test_marshal_string_none(self): connection = Connection(uuid.uuid4(), "server", 445) session = Session(connection, "user", "password") api = SCMRApi(session) expected = b"\x00\x00\x00\x00" actual = api._marshal_string(None) assert actual == expected
def test_marshal_string_as_referent(self): connection = Connection(uuid.uuid4(), "server", 445) session = Session(connection, "user", "password") api = SCMRApi(session) expected = b"\x00\x00\x00\x01" \ b"\x03\x00\x00\x00" \ b"\x00\x00\x00\x00" \ b"\x03\x00\x00\x00" \ b"\x68\x00\x69\x00\x00\x00" \ b"\x00\x00" actual = api._marshal_string("hi", unique=True) assert actual == expected