def test_parse_free_space_response(self): content = '<?xml version="1.0" encoding="utf-8"?><d:multistatus xmlns:d="DAV:"><d:response><d:href>/</d:href>' \ '<d:propstat><d:status>HTTP/1.1 200 OK</d:status><d:prop><d:quota-used-bytes>697' \ '</d:quota-used-bytes><d:quota-available-bytes>10737417543</d:quota-available-bytes></d:prop>' \ '</d:propstat></d:response></d:multistatus>' result = utils.parse_free_space_response(content.encode('utf-8'), 'localhost') self.assertEqual(result, 10737417543)
def test_parse_free_space_response_incorrect(self): content = read_file_content( './tests/responses/free_space_incorrect.xml') result = Utils.parse_free_space_response(content, 'localhost') self.assertEqual(result, '')