Esempio n. 1
0
 def test_repr_negations_interspersed(self):
     l = ['a', '~b', 'a', '~d']
     a = Applications(l)
     is_negation = lambda x: x.startswith(a.negation_prefix)
     GOAL = filter(lambda x: not is_negation(x), set(l)) + filter(
         is_negation, l)
     self.assertEqual('%r' % a,
                      "%s(%r, '~')" % (a.__class__.__name__, GOAL))
Esempio n. 2
0
 def _make_instances(self, Classes, Applications, Parameters, Exports):
     return Classes(), Applications(), Parameters(), Exports()
Esempio n. 3
0
 def test_repr_negations(self):
     negater = '~'
     a = Applications(TESTLIST2, negation_prefix=negater)
     self.assertEqual(
         '%r' % a,
         "%s(%r, '%s')" % (a.__class__.__name__, TESTLIST2, negater))
Esempio n. 4
0
 def test_repr_empty(self):
     negater = '%%'
     a = Applications(negation_prefix=negater)
     self.assertEqual('%r' % a,
                      "%s(%r, '%s')" % (a.__class__.__name__, [], negater))
Esempio n. 5
0
 def test_append_if_new_negate(self):
     a = Applications(TESTLIST1)
     a.append_if_new(TESTLIST2[2])
     self.assertSequenceEqual(a, TESTLIST1[::2])
Esempio n. 6
0
 def test_merge_unique_negate_instance(self):
     a = Applications(TESTLIST1)
     a.merge_unique(Applications(TESTLIST2))
     self.assertSequenceEqual(a, GOALLIST)
Esempio n. 7
0
 def test_constructor_negate(self):
     a = Applications(TESTLIST1 + TESTLIST2)
     self.assertSequenceEqual(a, GOALLIST)
Esempio n. 8
0
 def test_inheritance(self):
     a = Applications()
     self.assertIsInstance(a, Classes)