Esempio n. 1
0
def test_account_should_keep_configuration():
	account = Account(enabled=True,
					  name='my name',
					  user='******',
					  password='******',
					  oauth2string='who knows',
					  server='example.org',
					  port='1234',
					  ssl=True,
					  imap=True,
					  idle=True,
					  folders=['a', 'b'],
					  mailbox_type='mybox')
	config = account.get_config()
	expected_config = {
		'enabled': True,
		'name': 'my name',
		'user': '******',
		'password': '******',
		'oauth2string': 'who knows',
		'server': 'example.org',
		'port': '1234',
		'ssl': True,
		'imap': True,
		'idle': True,
		'folders': ['a', 'b'],
		'mailbox_type': 'mybox',
	}
	assert expected_config == config
Esempio n. 2
0
def test_account_should_store_configuration():
	new_config = {
		'user': '******',
		'password': '******',
		'oauth2string': 'who knows',
		'server': 'example.org',
		'port': '1234',
		'ssl': True,
		'imap': True,
		'idle': True,
		'folders': ['a', 'b'],
	}
	account = Account()
	account.set_config(mailbox_type='mybox', name='my name', enabled=True, config=new_config)
	config = account.get_config()
	expected_config = {
		'enabled': True,
		'name': 'my name',
		'user': '******',
		'password': '******',
		'oauth2string': 'who knows',
		'server': 'example.org',
		'port': '1234',
		'ssl': True,
		'imap': True,
		'idle': True,
		'folders': ['a', 'b'],
		'mailbox_type': 'mybox',
	}
	assert expected_config == config
Esempio n. 3
0
def test_account_should_keep_configuration():
    account = Account(
        enabled=True,
        name="my name",
        user="******",
        password="******",
        oauth2string="who knows",
        server="example.org",
        port="1234",
        ssl=True,
        imap=True,
        idle=True,
        folders=["a", "b"],
        mailbox_type="mybox",
    )
    config = account.get_config()
    expected_config = {
        "enabled": True,
        "name": "my name",
        "user": "******",
        "password": "******",
        "oauth2string": "who knows",
        "server": "example.org",
        "port": "1234",
        "ssl": True,
        "imap": True,
        "idle": True,
        "folders": ["a", "b"],
        "mailbox_type": "mybox",
    }
    assert expected_config == config
Esempio n. 4
0
def test_account_should_store_configuration():
    new_config = {
        'user': '******',
        'password': '******',
        'oauth2string': 'who knows',
        'server': 'example.org',
        'port': '1234',
        'ssl': True,
        'imap': True,
        'idle': True,
        'folders': ['a', 'b'],
    }
    account = Account()
    account.set_config(mailbox_type='mybox',
                       name='my name',
                       enabled=True,
                       config=new_config)
    config = account.get_config()
    expected_config = {
        'enabled': True,
        'name': 'my name',
        'user': '******',
        'password': '******',
        'oauth2string': 'who knows',
        'server': 'example.org',
        'port': '1234',
        'ssl': True,
        'imap': True,
        'idle': True,
        'folders': ['a', 'b'],
        'mailbox_type': 'mybox',
    }
    assert expected_config == config
Esempio n. 5
0
def test_account_should_keep_configuration():
    account = Account(enabled=True,
                      name='my name',
                      user='******',
                      password='******',
                      oauth2string='who knows',
                      server='example.org',
                      port='1234',
                      ssl=True,
                      imap=True,
                      idle=True,
                      folders=['a', 'b'],
                      mailbox_type='mybox')
    config = account.get_config()
    expected_config = {
        'enabled': True,
        'name': 'my name',
        'user': '******',
        'password': '******',
        'oauth2string': 'who knows',
        'server': 'example.org',
        'port': '1234',
        'ssl': True,
        'imap': True,
        'idle': True,
        'folders': ['a', 'b'],
        'mailbox_type': 'mybox',
    }
    assert expected_config == config
Esempio n. 6
0
def test_account_should_configurable_with_any_parameters():
	account = Account(weird='odd', odd='weird')
	config = account.get_config()
	assert config['weird'] == 'odd'
	assert config['odd'] == 'weird'
Esempio n. 7
0
def test_type_should_be_empty_by_default():
	account = Account()
	config = account.get_config()
	assert account.mailbox_type == ''
	assert config['mailbox_type'] == ''
Esempio n. 8
0
def test_account_config_should_always_contain_certain_values():
	account = Account()
	config = account.get_config()
	assert 'enabled' in config
	assert 'name' in config
	assert 'mailbox_type' in config
Esempio n. 9
0
def test_account_should_configurable_with_any_parameters():
    account = Account(weird="odd", odd="weird")
    config = account.get_config()
    assert config["weird"] == "odd"
    assert config["odd"] == "weird"
Esempio n. 10
0
def test_account_config_should_always_contain_certain_values():
    account = Account()
    config = account.get_config()
    assert "enabled" in config
    assert "name" in config
    assert "mailbox_type" in config
Esempio n. 11
0
def test_account_should_configurable_with_any_parameters():
    account = Account(weird='odd', odd='weird')
    config = account.get_config()
    assert config['weird'] == 'odd'
    assert config['odd'] == 'weird'
Esempio n. 12
0
def test_type_should_be_empty_by_default():
    account = Account()
    config = account.get_config()
    assert account.mailbox_type == ''
    assert config['mailbox_type'] == ''
Esempio n. 13
0
def test_account_config_should_always_contain_certain_values():
    account = Account()
    config = account.get_config()
    assert 'enabled' in config
    assert 'name' in config
    assert 'mailbox_type' in config