Ejemplo n.º 1
0
 def test_exclusive_g_l_selectors(self):
     # >1,<1
     a = [(operator.gt, ('00000001', '*final')),
          (operator.lt, ('00000001', '*final'))]
     self.assertRaises(ExclusiveVersionRequirements,
                       remove_useless_version_selectors, a)
     # >=1,<1
     a = [(operator.ge, ('00000001', '*final')),
          (operator.lt, ('00000001', '*final'))]
     self.assertRaises(ExclusiveVersionRequirements,
                       remove_useless_version_selectors, a)
     # >1,<=1
     a = [(operator.gt, ('00000001', '*final')),
          (operator.le, ('00000001', '*final'))]
     self.assertRaises(ExclusiveVersionRequirements,
                       remove_useless_version_selectors, a)
     # >=1,<=1
     a = [(operator.ge, ('00000001', '*final')),
          (operator.le, ('00000001', '*final'))]
     b = [(operator.eq, ('00000001', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
     # >2,<1
     # >=2,<1
     # >=2,<=1
     # >2,<=1
     a = [(operator.gt, ('00000002', '*final')),
          (operator.lt, ('00000001', '*final'))]
     self.assertRaises(ExclusiveVersionRequirements,
                       remove_useless_version_selectors, a)
Ejemplo n.º 2
0
 def test_overlap_ge_gt(self):
     # >=1,>2    >2
     a = [(operator.ge, ('00000001', '*final')),
          (operator.gt, ('00000002', '*final'))]
     b = [(operator.gt, ('00000002', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
     # >=1,>1    >1
     a = [(operator.ge, ('00000001', '*final')),
          (operator.gt, ('00000001', '*final'))]
     b = [(operator.gt, ('00000001', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
     # >=2,>1    >=2
     a = [(operator.ge, ('00000002', '*final')),
          (operator.gt, ('00000001', '*final'))]
     b = [(operator.ge, ('00000002', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
Ejemplo n.º 3
0
 def test_overlap_le_lt(self):
     # <=1,<2    <=1
     a = [(operator.le, ('00000001', '*final')),
          (operator.lt, ('00000002', '*final'))]
     b = [(operator.le, ('00000001', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
     # <=1,<1    <1
     a = [(operator.le, ('00000001', '*final')),
          (operator.lt, ('00000001', '*final'))]
     b = [(operator.lt, ('00000001', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
     # <=2,<1    <1
     a = [(operator.le, ('00000002', '*final')),
          (operator.lt, ('00000001', '*final'))]
     b = [(operator.lt, ('00000001', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
Ejemplo n.º 4
0
 def test_overlap_le(self):
     a = [(operator.le, ('00000001', '*final')),
          (operator.le, ('00000002', '*final'))]
     b = [(operator.le, ('00000001', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)
Ejemplo n.º 5
0
 def test_dupplicate(self):
     a = [(operator.gt, ('00000001', '*final')),
          (operator.gt, ('00000001', '*final'))]
     b = [(operator.gt, ('00000001', '*final'))]
     self.assertEqual(remove_useless_version_selectors(a), b)