def test_list_non_range_criteria(self): '''Ensure non-range criteria lists correctly''' myplatform = "SUNW,Sun-Fire-V250" mycriteria = {"platform": myplatform} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("platform")) self.assertEquals(cri_dict["platform"], myplatform)
def test_list_setting_none(self): '''Ensure None setting handled correctly''' mycriteria = {"arch": "sun4u", "cpu": None} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(cri_dict["arch"], "sun4u") self.assertEquals(cri_dict["cpu"], "")
def test_list_setting_none(self): '''Ensure None setting handled correctly''' mycriteria = {"arch": "sun4u", "cpu": None} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(cri_dict["arch"], "sun4u") self.assertEquals(cri_dict["cpu"], "")
def test_width(self): '''Ensure width returned correctly''' mycriteria = {"arch": "sun4v", "platform":"SUNW,Sun-Fire-V250", "cpu": "sparc"} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("platform"))
def test_list_non_range_criteria(self): '''Ensure non-range criteria lists correctly''' myplatform = "SUNW,Sun-Fire-V250" mycriteria = {"platform": myplatform} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("platform")) self.assertEquals(cri_dict["platform"], myplatform)
def test_list_range_unbounded_max_side(self): '''Ensure range with unbounded maximum list correctly''' mycriteria = {"MINmem": 2048} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("mem")) self.assertEquals(cri_dict["mem"], "2048 MB - unbounded")
def test_list_range_unbounded_min_side(self): '''Ensure range with unbounded minimum list correctly''' mycriteria = {"MAXipv4": '124213023291'} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("ipv4")) self.assertEquals(cri_dict["ipv4"], "unbounded - 124.213.23.291")
def test_list_range_bounded_same_on_both_sides(self): '''Ensure range bounded with same values list correctly''' mycriteria = {"MINmac": u'00ABCDEF0122', "MAXmac": u'00ABCDEF0122'} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("mac")) self.assertEquals(cri_dict["mac"], "00:AB:CD:EF:01:22")
def test_list_range_bounded_both_sides(self): '''Ensure range bounded with different values list correctly''' mycriteria = {"MAXmem": 2048, "MINmem": 512} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("mem")) self.assertEquals(cri_dict["mem"], "512 MB - 2048 MB")
def test_list_range_unbounded_max_side(self): '''Ensure range with unbounded maximum list correctly''' mycriteria = {"MINmem": 2048} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("mem")) self.assertEquals(cri_dict["mem"], "2048 MB - unbounded")
def test_list_range_unbounded_min_side(self): '''Ensure range with unbounded minimum list correctly''' mycriteria = {"MAXipv4": '124213023291'} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("ipv4")) self.assertEquals(cri_dict["ipv4"], "unbounded - 124.213.23.291")
def test_list_range_bounded_same_on_both_sides(self): '''Ensure range bounded with same values list correctly''' mycriteria = {"MINmac": u'00ABCDEF0122', "MAXmac": u'00ABCDEF0122'} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("mac")) self.assertEquals(cri_dict["mac"], "00:AB:CD:EF:01:22")
def test_list_range_bounded_both_sides(self): '''Ensure range bounded with different values list correctly''' mycriteria = {"MAXmem": 2048, "MINmem": 512} cri_dict, width = list.get_criteria_info(mycriteria) self.assertEquals(width, len("mem")) self.assertEquals(cri_dict["mem"], "512 MB - 2048 MB")