# Path: kinto-remote-settings/tests/signer/support.py
# class BaseWebTest(CoreWebTest):
#     api_prefix = "v1"
#     entry_point = kinto_main
#     config = "config/signer.ini"
# 
#     def __init__(self, *args, **kwargs):
#         super(BaseWebTest, self).__init__(*args, **kwargs)
#         self.headers.update(get_user_headers("mat"))
# 
#     @classmethod
#     def get_app_settings(cls, extras=None):
#         ini_path = os.path.join(here, cls.config)
#         config = configparser.ConfigParser()
#         config.read(ini_path)
#         settings = dict(config.items("app:main"))
#         settings["signer.to_review_enabled"] = False
#         return settings


import unittest
from .support import BaseWebTest



class AutocreateTest(BaseWebTest, unittest.TestCase):
    config = "config/autocreate.ini"

    def test_resources_were_created(self):
        write_perms = sorted(["system.Authenticated", "account:admin"])

        r = self.app.get("/buckets/main-workspace", headers=self.headers)

# Path: kinto-remote-settings/tests/signer/support.py
# class BaseWebTest(CoreWebTest):
#     api_prefix = "v1"
#     entry_point = kinto_main
#     config = "config/signer.ini"
# 
#     def __init__(self, *args, **kwargs):
#         super(BaseWebTest, self).__init__(*args, **kwargs)
#         self.headers.update(get_user_headers("mat"))
# 
#     @classmethod
#     def get_app_settings(cls, extras=None):
#         ini_path = os.path.join(here, cls.config)
#         config = configparser.ConfigParser()
#         config.read(ini_path)
#         settings = dict(config.items("app:main"))
#         settings["signer.to_review_enabled"] = False
#         return settings


# Path: kinto-remote-settings/tests/signer/test_autocreate_resources.py
import unittest
from .support import BaseWebTest




class AutocreateTest(BaseWebTest, unittest.TestCase):
    config = "config/autocreate.ini"

    def test_resources_were_created(self):
        write_perms = sorted(["system.Authenticated", "account:admin"])

        r = self.app.get("/buckets/main-workspace", headers=self.headers)

        assert sorted(r.json["permissions"]["write"]) == write_perms