# Path: syncano_cli/config.py
# ACCOUNT_CONFIG = ConfigParser()
# 
# ACCOUNT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.syncano')
# 
# Path: syncano_cli/main.py
# def main():


import os
import unittest
import syncano
import yaml
from datetime import datetime
from hashlib import md5
from uuid import uuid4
from click.testing import CliRunner
from syncano.models import RuntimeChoices
from syncano_cli.config import ACCOUNT_CONFIG, ACCOUNT_CONFIG_PATH
from syncano_cli.main import cli
        hash_feed = '{}{}'.format(uuid4(), datetime.now())
        return md5(hash_feed.encode('ascii')).hexdigest()


class InstanceMixin(object):

    @classmethod
    def setUpClass(cls):
        super(InstanceMixin, cls).setUpClass()

        cls.instance = cls.connection.Instance.please.create(
            name='test-cli-i%s' % cls.generate_hash()[:10],
            description='IntegrationTest %s' % datetime.now(),
        )

    @classmethod
    def tearDownClass(cls):
        cls.instance.delete()
        super(InstanceMixin, cls).tearDownClass()


class BaseCLITest(InstanceMixin, IntegrationTest):

    @classmethod
    def setUpClass(cls):
        super(BaseCLITest, cls).setUpClass()
        cls.yml_file = 'syncano.yml'
        cls.scripts_dir = 'scripts/'

    def setUp(self):

# Path: syncano_cli/config.py
# ACCOUNT_CONFIG = ConfigParser()
# 
# ACCOUNT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.syncano')
# 
# Path: syncano_cli/main.py
# def main():


# Path: tests/base.py
import os
import unittest
import syncano
import yaml
from datetime import datetime
from hashlib import md5
from uuid import uuid4
from click.testing import CliRunner
from syncano.models import RuntimeChoices
from syncano_cli.config import ACCOUNT_CONFIG, ACCOUNT_CONFIG_PATH
from syncano_cli.main import cli

        hash_feed = '{}{}'.format(uuid4(), datetime.now())
        return md5(hash_feed.encode('ascii')).hexdigest()


class InstanceMixin(object):

    @classmethod
    def setUpClass(cls):
        super(InstanceMixin, cls).setUpClass()

        cls.instance = cls.connection.Instance.please.create(
            name='test-cli-i%s' % cls.generate_hash()[:10],
            description='IntegrationTest %s' % datetime.now(),
        )

    @classmethod
    def tearDownClass(cls):
        cls.instance.delete()
        super(InstanceMixin, cls).tearDownClass()


class BaseCLITest(InstanceMixin, IntegrationTest):

    @classmethod
    def setUpClass(cls):
        super(BaseCLITest, cls).setUpClass()
        cls.yml_file = 'syncano.yml'
        cls.scripts_dir = 'scripts/'

    def setUp(self):

        self.runner.invoke(cli, args=['login', '--instance-name', self.instance.name], obj={})