示例#1
0
 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)
示例#2
0
 def test_cls_from_string(self):
     self.assertEqual(Packages, model.get_deb822_cls("Packages.gz"))
     self.assertEqual(Sources, model.get_deb822_cls("Sources.gz"))
示例#3
0
 def test_cls_from_package_dict(self):
     cls = model.get_deb822_cls(PACKAGE)
     self.assertEqual(cls, Packages)