def test_find_method_finds_the_given_representation(self): """testing if Representation.find() finds the latest version with the given representation. """ rep = Representation(self.version1) result = rep.find('BBox') self.assertEqual(self.version5, result)
def test_find_method_finds_the_given_repr_from_different_repr(self): """testing if Representation.find() finds the latest version with the given representation from a different representation than the base one. """ rep = Representation(self.version4) result = rep.find('ASS') self.assertEqual(self.version7, result)
def get_base(self): """returns the base version instance """ from anima.env.mayaEnv import Maya m = Maya() v = m.get_version_from_full_path(self.path) if v is None: return True rep = Representation(version=v) return rep.find(rep.base_repr_name)
def find_repr(self, repr_name): """Finds the representation with the given repr_name. :param str repr_name: The desired repr name :return: :class:`.Version` """ from anima.env.mayaEnv import Maya m = Maya() v = m.get_version_from_full_path(self.path) if v is None: return rep = Representation(version=v) rep_v = rep.find(repr_name) return rep_v
def test_find_method_returns_none_for_invalid_repr_name(self): """testing if Representation.find() returns None for invalid or nonexistent repr name """ rep = Representation(self.version4) self.assertTrue(rep.find('NonExists') is None)