def test_cls_from_resource(self): data = [("packages", Packages), ("sources", Sources)] for cls_type, cls_expected in data: resource = {"type": cls_type} cls = model.get_deb822_cls(resource) self.assertEqual(cls_expected, cls)
def test_cls_from_string(self): self.assertEqual(Packages, model.get_deb822_cls("Packages.gz")) self.assertEqual(Sources, model.get_deb822_cls("Sources.gz"))
def test_cls_from_package_dict(self): cls = model.get_deb822_cls(PACKAGE) self.assertEqual(cls, Packages)