Commit 5e8d221c authored by Steven Gueguen's avatar Steven Gueguen

Initial commit for tests

parent 6cdfe5f8
from setuptools import setup, find_packages
setup(
name='slapos.test.warp10',
version='0.0.1',
description="Test for SlapOS' Warp 10",
long_description="Tests for the Warp 10 platform software release",
long_description_content_type='text/markdown',
maintainer="SenX",
maintainer_email="contact@senx.io",
url="https://lab.nexedi.com/nexedi/slapos",
packages=find_packages(),
install_requires=[
'slapos.core',
'slapos.libnetworkcache',
'erp5.util',
'requests',
],
zip_safe=True,
test_suite='test',
)
import requests
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class TestWarp10(SlapOSInstanceTestCase):
def test_web(self):
params = self.computer_partition.getConnectionParameterDict()
# check that tokens are not empty ( like @tomo suggested - EDIT: I misunderstood, his idea was to check this in a promise )
self.assertTrue(params['read-token'])
response = requests.get(params['url'])
# # maybe tokens are needed here for authentication, then it could be something like that instead:
# response = requests.get(url, headers={'read-token': params['read-token']})
self.assertEqual(requests.codes['OK'], response.status_code)
# self.assertIn("*** something expected in the HTML page ***", response.text)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment