~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/tests/test_processor.py

  • Committer: Francis J. Lacoste
  • Date: 2011-07-14 21:49:37 UTC
  • mto: This revision was merged to the branch mainline in revision 13501.
  • Revision ID: francis.lacoste@canonical.com-20110714214937-redwzax7e3ti1wxe
Lint sucks, but hoover blows.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)
51
52
 
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(
 
57
            "avr", "Atmel AVR",
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",
 
61
            restricted=True)
59
62
        self.assertFalse(normal_family in family_set.getRestricted())
60
63
        self.assertTrue(restricted_family in family_set.getRestricted())
61
64
 
85
88
            ['g4', 'i686', 'q1'],
86
89
            sorted(
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_')))
89
92
 
90
93
 
91
94
class ProcessorSetWebServiceTests(TestCaseWithFactory):
120
123
        self.assertEquals(
121
124
            ['g4', 'i686', 'q1'],
122
125
            sorted(
123
 
            processor['name'] for processor in collection['entries'] if not processor['name'].startswith('sample_data_') ))
 
126
            processor['name'] for processor in collection['entries']
 
127
            if not processor['name'].startswith('sample_data_')))