diff options
author | jiansong <jian.song@easystack.cn> | 2016-09-18 00:20:00 -0700 |
---|---|---|
committer | jiansong <jian.song@easystack.cn> | 2016-09-20 07:20:57 -0700 |
commit | 2223c83171f8eba26ed113f19ba41c30b833559f (patch) | |
tree | 19193888921c31d44cffb68caed61c88be3d0e60 /trove | |
parent | 2808e1af461911afce025e551e404bedba98dfe0 (diff) | |
download | trove-2223c83171f8eba26ed113f19ba41c30b833559f.tar.gz |
Perfect the mysql test
In test_populate_users_intermingled,Should be mixed the above
three test, should have a total of four records.One is the
foundation,Other records with this relationship should be
1.same name,differ host.
2.differ name,same host.
3.same name,same host.
4.differ name,differ host.
At the same time joined the differ name, differ the
host test in two record test
Change-Id: I92c94cc4c352e6ad96a95d64313807f160072aa4
Diffstat (limited to 'trove')
-rw-r--r-- | trove/tests/unittests/mysql/test_common.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/trove/tests/unittests/mysql/test_common.py b/trove/tests/unittests/mysql/test_common.py index 214b4d50..001bd8df 100644 --- a/trove/tests/unittests/mysql/test_common.py +++ b/trove/tests/unittests/mysql/test_common.py @@ -81,10 +81,18 @@ class MySqlCommonTest(trove_testtools.TestCase): self.assertRaises(DatabaseInitialUserDuplicateError, populate_users, users) + def test_populate_unique_users_unique_host(self): + users = [{'name': 'bob', 'password': 'x', 'host': '127.0.0.1'}, + {'name': 'tom', 'password': 'x', 'host': '128.0.0.1'}] + result = populate_users(users) + self.assertThat(len(result), Is(2)) + def test_populate_users_intermingled(self): users = [{'name': 'bob', 'password': 'x', 'host': '127.0.0.1'}, - {'name': 'tom', 'password': 'y', 'host': '128.0.0.1'}, - {'name': 'bob', 'password': 'z', 'host': '127.0.0.1'}] + {'name': 'tom', 'password': 'y', 'host': '127.0.0.1'}, + {'name': 'bob', 'password': 'z', 'host': '127.0.0.1'}, + {'name': 'bob', 'password': 'x', 'host': '128.0.0.1'}, + {'name': 'tom', 'password': 'x', 'host': '128.0.0.1'}] self.assertRaises(DatabaseInitialUserDuplicateError, populate_users, users) |