mirror of https://github.com/sipwise/repoapi.git
Using https://django-appconf.readthedocs.io/en/latest/ helps us to keep configs per application Change-Id: Id41f0f6ce6b008428a1136f85ecf3b9d86f3189fchanges/18/38718/3
parent
3237f930fd
commit
7647cfcc48
@ -0,0 +1,24 @@
|
||||
# Copyright (C) 2020 The Sipwise Team - http://sipwise.com
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the Free
|
||||
# Software Foundation, either version 3 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
from django.conf import settings # noqa
|
||||
from appconf import AppConf
|
||||
|
||||
|
||||
class HotfixConf(AppConf):
|
||||
WF_REGEX = r"TT#(\d+)"
|
||||
ARTIFACT = "debian_changelog.txt"
|
||||
|
||||
class Meta:
|
||||
prefix = "hotfix"
|
||||
@ -0,0 +1,27 @@
|
||||
# Copyright (C) 2015 The Sipwise Team - http://sipwise.com
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the Free
|
||||
# Software Foundation, either version 3 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
# more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class TestHotfixConf(TestCase):
|
||||
def test_django_settings(self):
|
||||
from django.conf import settings
|
||||
|
||||
self.assertEqual(settings.HOTFIX_ARTIFACT, "debian_changelog.txt")
|
||||
|
||||
def test_hotfix_settings(self):
|
||||
from hotfix.conf import settings
|
||||
|
||||
self.assertEqual(settings.HOTFIX_ARTIFACT, "debian_changelog.txt")
|
||||
Loading…
Reference in new issue