1
from landscape.diff import diff
2
from landscape.tests.helpers import LandscapeTest
5
class DiffTest(LandscapeTest):
8
self.assertEquals(diff({}, {}), ({}, {}, {}))
10
def test_identical(self):
11
data = {"str": "wubble", "strlist": ["foo", "bar"]}
12
self.assertEquals(diff(data, data), ({}, {}, {}))
14
def test_create(self):
16
new = {"str": "wubble"}
17
self.assertEquals(diff(old, new), ({"str": "wubble"}, {}, {}))
19
def test_update(self):
20
old = {"str": "wubble"}
22
self.assertEquals(diff(old, new), ({}, {"str": "ooga"}, {}))
24
def test_delete(self):
25
old = {"str": "wubble"}
27
self.assertEquals(diff(old, new), ({}, {}, {"str": "wubble"}))
29
def test_complex(self):
30
old = {"str": "wubble", "int": 10}
31
new = {"strlist": ["foo", "bar"], "int": 25}
32
self.assertEquals(diff(old, new), ({"strlist": ["foo", "bar"]},