tokenbridge/deployment-e2e/molecule/repo/tests/test_existing.py
Przemyslaw Rzad 54858ae597
Molecule tests for deploying repository (#194)
* Squashed commits

* All jobs

* Rollback changes

* Dependencies

* Remove .git checking

* Resolve path issues

* New way of copying repository.

* Test non existing .git

* New repo task

* Typo

* Do not fail mkdir if folder exists

* Test double task

* zipping the archives

* Increase no_output_timeout because of slowly installing apt-get
2019-09-06 15:24:30 +02:00

50 lines
1.6 KiB
Python

import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("path", [
("/home/poadocker"),
("/home/poadocker/bridge"),
("/home/poadocker/bridge/commons"),
("/home/poadocker/bridge/e2e-commons"),
("/home/poadocker/bridge/deployment"),
("/home/poadocker/bridge/contracts"),
("/home/poadocker/bridge/oracle"),
("/home/poadocker/bridge/monitor"),
("/home/poadocker/bridge/ui"),
("/home/poadocker/bridge/parity")
])
def test_existing_folders(host, path):
assert host.file(path).exists
assert host.file(path).is_directory
@pytest.mark.parametrize("path", [
("/home/poadocker/bridge/package.json"),
("/home/poadocker/bridge/commons/package.json"),
("/home/poadocker/bridge/contracts/package.json"),
("/home/poadocker/bridge/oracle/package.json"),
("/home/poadocker/bridge/monitor/package.json"),
("/home/poadocker/bridge/ui/package.json")
])
def test_existing_package_json(host, path):
assert host.file(path).exists
assert host.file(path).is_file
@pytest.mark.parametrize("path", [
("/home/poadocker/bridge/Dockerfile.e2e"),
("/home/poadocker/bridge/contracts/Dockerfile"),
("/home/poadocker/bridge/parity/Dockerfile"),
("/home/poadocker/bridge/oracle/Dockerfile"),
("/home/poadocker/bridge/monitor/Dockerfile"),
("/home/poadocker/bridge/ui/Dockerfile")
])
def test_existing_docker_files(host, path):
assert host.file(path).exists
assert host.file(path).is_file