def test_identical_when_drivers_unmatched(self): driver1 = CodeResourceRevision() driver2 = CodeResourceRevision() user = User() m1 = Method(revision_name='A', driver=driver1, user=user) for i in range(2): inp = m1.inputs.create(dataset_name='a_in_{}'.format(i), dataset_idx=i + 1) inp.transformationinput = inp for i in range(3): out = m1.outputs.create(dataset_name='a_out_{}'.format(i), dataset_idx=i + 1) out.transformationoutput = out m2 = Method(revision_name='B', driver=driver2, user=user) for i in range(2): inp = m2.inputs.create(dataset_name='b_in_{}'.format(i), dataset_idx=i + 1) inp.transformationinput = inp for i in range(3): out = m2.outputs.create(dataset_name='b_in_{}'.format(i), dataset_idx=i + 1) out.transformationoutput = out self.assertFalse(m1.is_identical(m2))
def test_identical_self(self): """A Method should be identical to itself.""" m = Method(driver=CodeResourceRevision(), user=User()) self.assertTrue(m.is_identical(m))