Beispiel #1
0
    def test_make_entry_new_no_frequency_with_previous_no_value(self):
        entry = None
        previous = {'name': 'a name', 'frequency': 0}
        expected = None

        result = MappingList.make_entry('a name', entry, 0, previous)
        self.assertEquals(result, expected)
Beispiel #2
0
    def test_make_entry_new_no_entry(self):
        entry = None
        previous = None
        expected = self.base_format
        expected['name'] = 'a name'
        expected['frequency'] = 2

        result = MappingList.make_entry('a name', entry, 2, previous)
        self.assertEquals(result, expected)
Beispiel #3
0
    def test_make_entry_new_with_previous_and_entry(self):
        entry = {'more': 'foo'}
        previous = {'name': 'a name', 'frequency': 0, 'bar': 'foobar'}
        expected = {
            'name': 'a name',
            'more': 'foo',
            'bar': 'foobar',
            'frequency': 2
        }

        result = MappingList.make_entry('a name', entry, 2, previous)
        self.assertEquals(result, expected)
Beispiel #4
0
 def test_make_entry_empty(self):
     result = MappingList.make_entry('a name', None, 0, None)
     self.assertEquals(result, None)