1818 dict (tablet_type = topodata_pb2 .RDONLY ),
1919 ])
2020
21+ _just_master = dict (
22+ served_types = [
23+ dict (tablet_type = topodata_pb2 .MASTER ),
24+ ])
25+
2126
2227class FixServedTypesTest (unittest .TestCase ):
2328
@@ -27,7 +32,7 @@ def test_get_vtctl_commands(self):
2732 [('-80' , _all_types ), ('80-' , _all_types ), ('0' , {})],
2833 [('-80' , {}), ('80-' , {}), ('0' , _all_types )],
2934 [('-80' , {}), ('80-' , _all_types ), ('0' , _all_types )],
30- [('-80' , {} ), ('80-' , _no_master ), ('0' , _all_types )]
35+ [('-80' , _no_master ), ('80-' , _no_master ), ('0' , _just_master )]
3136 ]]
3237
3338 expected_results = [
@@ -59,7 +64,9 @@ def test_get_vtctl_commands(self):
5964 ['SetShardServedTypes' , 'foo/0' , 'rdonly' ],
6065 ['SetShardServedTypes' , 'foo/0' , 'master' ]],
6166
62- [['SetShardServedTypes' , '--remove' , 'foo/80-' , 'replica' ],
67+ [['SetShardServedTypes' , '--remove' , 'foo/-80' , 'replica' ],
68+ ['SetShardServedTypes' , '--remove' , 'foo/-80' , 'rdonly' ],
69+ ['SetShardServedTypes' , '--remove' , 'foo/80-' , 'replica' ],
6370 ['SetShardServedTypes' , '--remove' , 'foo/80-' , 'rdonly' ],
6471 ['SetShardServedTypes' , 'foo/0' , 'replica' ],
6572 ['SetShardServedTypes' , 'foo/0' , 'rdonly' ],
0 commit comments