Example #1
0
 def test_builder_8(self):
     c = Forbid(self.prop2) & Forbid(self.prop1)
     self.assertEqual('[[-2], [-1]]', str(c.cnf()))
     self.assertDictEqual({
         1: url_by_name('BAR'),
         2: url_by_name('FOO')
     }, c.props)
Example #2
0
 def test_builder_22(self):
     c = Forbid(self.prop3) & Require(self.prop2)
     self.assertEqual('[[-1], [2]]', str(c.cnf()))
     self.assertDictEqual({
         1: url_by_name('BAZ'),
         2: url_by_name('BAR')
     }, c.props)
Example #3
0
 def test_builder_18(self):
     c = Require(self.prop3) & Forbid(self.prop2) & Forbid(self.prop1)
     self.assertEqual('[[-3], [-2], [1]]', str(c.cnf()))
     self.assertDictEqual(
         {
             1: url_by_name('BAZ'),
             2: url_by_name('BAR'),
             3: url_by_name('FOO')
         }, c.props)
Example #4
0
 def requirements(self):
     return Require(
         self.source1) & Any(Require(self.source2)
                             | Require(self.source3)) & Forbid(
                                 self.forbidden)
Example #5
0
 def requirements(self) -> ConjunctionBuilder:
     return Any(
         Forbid(url_by_name('BAZ')) | Require(url_by_name('BAR'))
         | Forbid(url_by_name('BAM'))) & Any(
             Require(url_by_name('FOO')) | Forbid(url_by_name('CAT')))
Example #6
0
 def test_builder_6(self):
     c = Forbid(self.prop2)
     self.assertEqual('[[-1]]', str(c.cnf()))
     self.assertDictEqual({1: url_by_name('BAR')}, c.props)