def test_build_unique_id_different(): m = FakeModule(**{ 'name': 'ansible-unittest-1', 'description': 'test-unique-id' }) m2 = FakeModule(**{ 'name': 'ansible-unittest-1', 'description': 'test-unique-id-different' }) assert data_pipeline.build_unique_id(m) != data_pipeline.build_unique_id( m2)
def test_build_unique_id_obj(): # check that the object can be different and the unique id should be the same; should be able to modify objects m = FakeModule(**{ 'name': 'ansible-unittest-1', 'objects': [{ 'first': 'object' }] }) m2 = FakeModule(**{ 'name': 'ansible-unittest-1', 'objects': [{ 'second': 'object' }] }) assert data_pipeline.build_unique_id(m) == data_pipeline.build_unique_id( m2)
def test_build_unique_id_same(): m = FakeModule( **{ 'name': 'ansible-unittest-1', 'description': 'test-unique-id', 'tags': { 'ansible': 'test' } }) m2 = FakeModule( **{ 'name': 'ansible-unittest-1', 'description': 'test-unique-id', 'tags': { 'ansible': 'test' } }) assert data_pipeline.build_unique_id(m) == data_pipeline.build_unique_id( m2)
def test_build_unique_id_obj(placeboify, maybe_sleep): # check that the object can be different and the unique id should be the same; should be able to modify objects m = FakeModule(**{'name': 'ansible-unittest-1', 'objects': [{'first': 'object'}]}) m2 = FakeModule(**{'name': 'ansible-unittest-1', 'objects': [{'second': 'object'}]}) assert data_pipeline.build_unique_id(m) == data_pipeline.build_unique_id(m2)
def test_build_unique_id_same(placeboify, maybe_sleep): m = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id', 'tags': {'ansible': 'test'}}) m2 = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id', 'tags': {'ansible': 'test'}}) assert data_pipeline.build_unique_id(m) == data_pipeline.build_unique_id(m2)
def test_build_unique_id_different(placeboify, maybe_sleep): m = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id'}) m2 = FakeModule(**{'name': 'ansible-unittest-1', 'description': 'test-unique-id-different'}) assert data_pipeline.build_unique_id(m) != data_pipeline.build_unique_id(m2)