# Path: tests/unit/test.py
# class TestCase(testtools.TestCase):
#     def setUp(self):
#     def mock_config(self, update=None):
#     def post(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def get(self, *args, **kwargs):


from tests.unit import test
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



class FakeApiTestCase(test.TestCase):

    def test_region_api_response_ok(self):
        self.mock_config({"use_fake_api_data": True})
        region = "north-2.piedpiper.net"
        path = "/api/v1/region/%s/infra" % region
        code, resp = self.get(path)
        self.assertEqual(code, 200, path)

    def test_region_api_response_not_found(self):
        self.mock_config({"use_fake_api_data": True})
        path = "/api/v1/region/unexpected_region/infra"
        code, resp = self.get(path)
        self.assertEqual(404, code, path)

    def test_regions_api_response_ok(self):
        self.mock_config({"use_fake_api_data": True})
        path = "/api/v1/infra"
        code, resp = self.get(path)
        self.assertEqual(200, code, path)



# Path: tests/unit/test.py
# class TestCase(testtools.TestCase):
#     def setUp(self):
#     def mock_config(self, update=None):
#     def post(self, *args, **kwargs):
#     def put(self, *args, **kwargs):
#     def delete(self, *args, **kwargs):
#     def get(self, *args, **kwargs):


# Path: tests/unit/api/v1/test_infrastructure.py
from tests.unit import test

#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



class FakeApiTestCase(test.TestCase):

    def test_region_api_response_ok(self):
        self.mock_config({"use_fake_api_data": True})
        region = "north-2.piedpiper.net"
        path = "/api/v1/region/%s/infra" % region
        code, resp = self.get(path)
        self.assertEqual(code, 200, path)

    def test_region_api_response_not_found(self):
        self.mock_config({"use_fake_api_data": True})
        path = "/api/v1/region/unexpected_region/infra"
        code, resp = self.get(path)
        self.assertEqual(404, code, path)

    def test_regions_api_response_ok(self):
        self.mock_config({"use_fake_api_data": True})
        path = "/api/v1/infra"
        code, resp = self.get(path)
        self.assertEqual(200, code, path)



class ApiTestCase(test.TestCase):