45
45
"""Test adding a new Processor to a ProcessorFamily."""
46
46
family = getUtility(IProcessorFamilySet).new("avr", "Atmel AVR",
47
47
"The Modified Harvard architecture 8-bit RISC processors.")
48
proc = family.addProcessor("avr2001", "The 2001 AVR", "Fast as light.")
48
proc = family.addProcessor(
49
"avr2001", "The 2001 AVR", "Fast as light.")
49
50
self.assertProvides(proc, IProcessor)
50
51
self.assertEquals(family, proc.family)
52
53
def test_get_restricted(self):
53
54
"""Test retrieving all restricted processors."""
54
55
family_set = getUtility(IProcessorFamilySet)
55
normal_family = getUtility(IProcessorFamilySet).new("avr", "Atmel AVR",
56
normal_family = getUtility(IProcessorFamilySet).new(
56
58
"The Modified Harvard architecture 8-bit RISC processors.")
57
restricted_family = getUtility(IProcessorFamilySet).new("5051", "5051",
58
"Another small processor family", restricted=True)
59
restricted_family = getUtility(IProcessorFamilySet).new(
60
"5051", "5051", "Another small processor family",
59
62
self.assertFalse(normal_family in family_set.getRestricted())
60
63
self.assertTrue(restricted_family in family_set.getRestricted())
85
88
['g4', 'i686', 'q1'],
87
90
processor.name for processor in processor_set.getAll()
88
if not processor.name.startswith('sample_data_') ))
91
if not processor.name.startswith('sample_data_')))
91
94
class ProcessorSetWebServiceTests(TestCaseWithFactory):