diff --git a/config.py b/config.py index d863adc0..dd7bf487 100644 --- a/config.py +++ b/config.py @@ -57,6 +57,11 @@ class DevConfiguration(BaseConfiguration): #FAS_PASSWORD = os.environ('FAS_PASSWORD') # you could store it here #FAS_PASSWORD = commands.getoutput('pass your_fas_password').strip() +class TestConfiguration(BaseConfiguration): + LOG_BACKEND = 'console' + SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:' + DEBUG = True + class ProdConfiguration(BaseConfiguration): FAS_USERNAME = 'TODO' diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..2a1e3f26 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,172 @@ +# Copyright (c) 2016 Red Hat, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Written by Matt Prahl + A fake module used for testing + license: + module: + - MIT + content: [] + xmd: ~ + dependencies: + buildrequires: + base_runtime: 1.0-0 + references: + community: https://fedoraproject.org/wiki/Modularity + tracker: https://taiga.fedorainfracloud.org/project/modularity + profiles: + default: + rpms: + - bash + components: + rpms: + api: + - bash + packages: + bash: + rationale: It's here to test the whole thing! + commit: 70fa7516b83768595a4f3280ae890a7ac957e0c7 diff --git a/tests/test_views/test_views.py b/tests/test_views/test_views.py new file mode 100644 index 00000000..580bcca1 --- /dev/null +++ b/tests/test_views/test_views.py @@ -0,0 +1,241 @@ +# Copyright (c) 2016 Red Hat, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Written by Matt Prahl