def test_merge_two_environments_merge_data_associated_with_each_variable( self): first = 'variable_name' second = 'other_variable_name' environment = Environment(environment={first: DataSet({'value1'}, 7)}) other_environment = Environment( environment={ first: DataSet({'value2'}, 7), second: DataSet({UNDEFINED}, UNKNOWN_SIZE) }) expected_environment = Environment( environment={ first: DataSet({'value1', 'value2'}, 7), second: DataSet({UNDEFINED}, UNKNOWN_SIZE) }) self.assertEqual(environment.merge(other_environment), expected_environment)
def test_merge_two_environments_merge_data_associated_with_each_variable( self): first = 'variable_name' second = 'other_variable_name' environment = Environment( environment={first: {claripy.BVV(b'value1\x00', 7 * 8)}}) other_environment = Environment(environment={ first: {claripy.BVV(b'value2\x00', 7 * 8)}, second: {UNDEFINED} }) expected_environment = Environment( environment={ first: { claripy.BVV(b'value1\x00', 7 * 8), claripy.BVV(b'value2\x00', 7 * 8) }, second: {UNDEFINED} }) self.assertEqual(environment.merge(other_environment), expected_environment)