def product(self, version): return Product(id=self.product_info['id'], name=self.product_info['name'], version=version, architectures=self.product_info['arch'], provided_tags=self.product_info['tags'])
def test_brand_name_none(self): p = Product(id="pid", name="pname", brand_name=None) self.assertTrue(p.brand_name is None)
def test_brand_name_empty_string(self): p = Product(id="pid", name="pname", brand_name="") self.assertEqual(p.brand_name, "")
def test_brand_name(self): p = Product(id="pid", name="pname", brand_name="pbrand_name") self.assertTrue(p.brand_name == "pbrand_name")
def test_brand_type_empty_string(self): p = Product(id='pid', name='pname', brand_type="") self.assertEqual(p.brand_type, "")
def test_no_brand_type(self): p = Product(id="pid", name="pname") self.assertTrue(p.brand_type is None)
def test_none_arch(self): p = Product(id="pid", name="pname") self.assertTrue(p.architectures is not None) self.assertTrue(isinstance(p.architectures, list))
def test_arch_multi_valued(self): p = Product(id="pid", name="pname", architectures="i386,x86_64") self.assertEqual(2, len(p.architectures)) self.assertEqual("i386", p.architectures[0]) self.assertEqual("x86_64", p.architectures[1])