initial commit
This commit is contained in:
parent
f0f033b4fb
commit
d0245e09fc
11 changed files with 294 additions and 0 deletions
32
python_apps/media-monitor2/tests/pure.py
Normal file
32
python_apps/media-monitor2/tests/pure.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
import media.monitor.pure as mmp
|
||||
|
||||
class TestMMP(unittest.TestCase):
|
||||
def test_apply_rules(self):
|
||||
sample_dict = {
|
||||
'key' : 'val',
|
||||
'test' : 'IT',
|
||||
}
|
||||
rules = {
|
||||
'key' : lambda x : x.upper(),
|
||||
'test' : lambda y : y.lower()
|
||||
}
|
||||
mmp.apply_rules_dict(sample_dict, rules)
|
||||
self.assertEqual(sample_dict['key'], 'VAL')
|
||||
self.assertEqual(sample_dict['test'], 'it')
|
||||
|
||||
def test_default_to(self):
|
||||
sd = { }
|
||||
def_keys = ['one','two','three']
|
||||
mmp.default_to(dictionary=sd, keys=def_keys, default='DEF')
|
||||
for k in def_keys: self.assertEqual( sd[k], 'DEF' )
|
||||
|
||||
def test_normalized_metadata(self):
|
||||
pass
|
||||
|
||||
def test_organized_path(self):
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__': unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue