Files
deb-python-dcos/tests/test_config.py
José Armando García Sancio 8349692faf DCOS-155 Implement marathon start
This commits includes:
  1. Restructuring of the directories so that command line entry points
  are in `dcos.cli`
  2. Refactored out the generic config functionality to a reusable
  module
  3. Basic implementation of the marathon cli for starting an
  application
  4. constant module for storing generic constants needed by multiple
  modules
  5. Rudimentary marathon interface using the HTTP REST api
  6. Added dependency on python's requests module/library
2015-01-21 15:48:58 +00:00

50 lines
987 B
Python

import pytest
from dcos import config
@pytest.fixture
def conf():
return config.Toml({
'dcos': {
'user': 'principal',
'mesos_uri': 'zk://localhost/mesos'
},
'package': {
'repo_uri': 'git://localhost/mesosphere/package-repo.git'
}
})
def test_unset_property(conf):
expect = config.Toml({
'dcos': {
'user': 'principal',
'mesos_uri': 'zk://localhost/mesos'
},
'package': {}
})
del conf['package.repo_uri']
assert conf == expect
def test_set_property(conf):
expect = config.Toml({
'dcos': {
'user': 'group',
'mesos_uri': 'zk://localhost/mesos'
},
'package': {
'repo_uri': 'git://localhost/mesosphere/package-repo.git'
}
})
conf['dcos.user'] = 'group'
assert conf == expect
def test_get_property(conf):
conf['dcos.mesos_uri'] == 'zk://localhost/mesos'