import unittest
from os.path import join, dirname, abspath

from clanvas.config import parse_clanvas_config_file


def parse(filename):
    return parse_clanvas_config_file(join(dirname(abspath(__file__)), filename))


expected_1 = {}
expected_2 = {"site1": {"url": "https://canvas.website1.edu", "token": "<KEY>"}}
expected_3 = {"site1": {"url": "https://canvas.website1.edu", "token": "<KEY>"},
              "site2": {"url": "https://canvas.website2.edu", "token": "<KEY>"}}


class TestConfigParser(unittest.TestCase):

    def test_1(self):
        self.assertDictEqual(expected_1, parse('config_1'))

    def test_2(self):
        self.assertDictEqual(expected_2, parse('config_2'))

    def test_3(self):
        self.assertDictEqual(expected_3, parse('config_3'))

import unittest
from os.path import join, dirname, abspath

from clanvas.config import parse_clanvas_config_file


def parse(filename):
    return parse_clanvas_config_file(join(dirname(abspath(__file__)), filename))


expected_1 = {}
expected_2 = {"site1": {"url": "https://canvas.website1.edu", "token": "<KEY>"}}
expected_3 = {"site1": {"url": "https://canvas.website1.edu", "token": "<KEY>"},
              "site2": {"url": "https://canvas.website2.edu", "token": "<KEY>"}}


class TestConfigParser(unittest.TestCase):

    def test_1(self):
        self.assertDictEqual(expected_1, parse('config_1'))

    def test_2(self):
        self.assertDictEqual(expected_2, parse('config_2'))

    def test_3(self):
        self.assertDictEqual(expected_3, parse('config_3'))
