2016-06-08 19:36:39 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
'''
|
|
|
|
:codeauthor: :email:`Joao Mesquita <jmesquita@sangoma.com>`
|
|
|
|
'''
|
|
|
|
|
2016-07-27 19:17:57 +00:00
|
|
|
# Import Python libs
|
2016-06-08 19:36:39 +00:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
|
|
|
# Import Salt Testing libs
|
2017-02-27 13:58:07 +00:00
|
|
|
from tests.support.unit import TestCase
|
2016-06-08 19:36:39 +00:00
|
|
|
|
|
|
|
from salt import fileserver
|
|
|
|
|
|
|
|
|
|
|
|
class MapDiffTestCase(TestCase):
|
|
|
|
def test_diff_with_diffent_keys(self):
|
|
|
|
'''
|
|
|
|
Test that different maps are indeed reported different
|
|
|
|
'''
|
|
|
|
map1 = {'file1': 1234}
|
|
|
|
map2 = {'file2': 1234}
|
|
|
|
assert fileserver.diff_mtime_map(map1, map2) is True
|
|
|
|
|
|
|
|
def test_diff_with_diffent_values(self):
|
|
|
|
'''
|
|
|
|
Test that different maps are indeed reported different
|
|
|
|
'''
|
|
|
|
map1 = {'file1': 12345}
|
|
|
|
map2 = {'file1': 1234}
|
|
|
|
assert fileserver.diff_mtime_map(map1, map2) is True
|