コード例 #1
0
 def testGetPathListWithValidYAML(self):
     """Test getPathList() method"""
     with mock.patch('__builtin__.open') as m:
         text = "/foo:\n  - children: 1"
         expected_dict = {'/foo': [{'children': 1}]}
         m.return_value = StringIO(text)
         self.assertEquals(expected_dict, runserver.getPathList('/test'))
コード例 #2
0
 def testGetPathListWithNoneFile(self):
     """Test getPathList() method with default path of None"""
     self.assertEquals({}, runserver.getPathList(None))
コード例 #3
0
 def testGetPathListWithInvalidFile(self):
     """Test getPathList() method with invalid File Path"""
     self.assertEquals({}, runserver.getPathList('/fake_path'))
コード例 #4
0
 def testGetPathListWithInvalidYAML(self):
     """Test getPathList() method with invalid YAML"""
     with mock.patch('__builtin__.open') as m:
         text = "/foo: \nbar"
         m.return_value = StringIO(text)
         self.assertEquals({}, runserver.getPathList('/test'))