Beispiel #1
0
 def test_writeModificationsFromSameBundle1(self):
   bundle = Modifications()
   add0 = Addition(11, "1", "me")
   add1 = Addition(12, "2", "me")
   add2 = Addition(13, "3", "me")
   rem1 = Removal(13, 1, "me")
   bundle.extend([add0,add1,add2,rem1])
   self.zone.add(bundle)
   self.zone.writeModifications()
   self.assertEqual(self.zone.content, "Hello World12")
Beispiel #2
0
class TestSuppression(TestCase):
    def setUp(self):
        self.file = File("test")
        self.removal = Removal(2, 2, "me")

    def tearDown(self):
        pass

    def test_getPosition(self):
        self.assertEqual(self.removal.position, 2)

    def test_getSize(self):
        self.assertEqual(self.removal.size, 2)

    def test_apply(self):
        self.removal.apply(self.file)
        self.assertEqual(self.file.content, "te")

    def test_update(self):
        modification = Addition(0, 5, "allo ", "me")
        self.removal.update(modification)
        self.assertEqual(self.removal.position, 7)

    def test_isAdd(self):
        self.assertFalse(self.removal.isAdd())

    def test_isRemove(self):
        self.assertTrue(self.removal.isRemove())
Beispiel #3
0
 def setUp(self):
   self.addition1 = Addition(6, 4, "allo", "me")
   self.removal1 = Removal(0, 11, "me")
   self.removal2 = Removal(6, 5, "me")
   self.addition2 = Addition(6, 5, "monde", "me")
   self.zone = TransitZone("Hello World")
Beispiel #4
0
 def test_mettreAJour(self):
     modification = Removal(1, 3, "me")
     self.addition.update(modification)
     self.assertEqual(self.addition.position, 1)
 def test_DeletesOverlaps1(self):
     removal1 = Removal(5, 3, "me")
     self.zone.add(removal1)
     self.zone.add(self.removal)
     self.zone.writeModifications()
     self.assertEqual(self.zone.content, "Hello")
 def setUp(self):
     self.zone = TransitZone("Hello World")
     self.removal = Removal(6, 5, "me")
 def test_DeletesSamePosition1(self):
     removal1 = Removal(6, 5, "me")
     self.zone.add(removal1)
     self.zone.add(self.removal)
     self.zone.writeModifications()
     self.assertEqual(self.zone.content, "Hello ")
 def test_DeletesNoOverlaps0(self):
     removal1 = Removal(0, 5, "me")
     self.zone.add(self.removal)
     self.zone.add(removal1)
     self.zone.writeModifications()
     self.assertEqual(self.zone.content, " ")
Beispiel #9
0
 def setUp(self):
     self.file = File("test")
     self.removal = Removal(2, 2, "me")