Skip to content

Commit e57af7e

Browse files
committed
Added test_dictionary_union method to TestUtilityFunctions
1 parent 1b2ac04 commit e57af7e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/test_rplot.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ def test_make_aes2(self):
4949
with self.assertRaises(ValueError):
5050
rplot.make_aes(alpha=rplot.ScaleShape('test'))
5151

52+
def test_dictionary_union(self):
53+
dict1 = {1 : 1, 2 : 2, 3 : 3}
54+
dict2 = {1 : 1, 2 : 2, 4 : 4}
55+
union = rplot.dictionary_union(dict1, dict2)
56+
self.assertEqual(len(union), 4)
57+
keys = union.keys()
58+
self.assertTrue(1 in keys)
59+
self.assertTrue(2 in keys)
60+
self.assertTrue(3 in keys)
61+
self.assertTrue(4 in keys)
62+
self.assertTrue(rplot.dictionary_union(dict1, {}) == dict1)
63+
self.assertTrue(rplot.dictionary_union({}, dict1) == dict1)
64+
self.assertTrue(rplot.dictionary_union({}, {}) == {})
65+
5266
class TestScaleGradient(unittest.TestCase):
5367
def setUp(self):
5468
path = os.path.join(curpath(), 'data/iris.csv')

0 commit comments

Comments
 (0)