# Path: lib/database.py
# class DatabaseError(Exception):
# class Database(object):
#     def __init__(self, value):
#     def __str__(self):
#     def __init__(self, settings):
#     def connect(self):
#     def disconnect(self):
#     def get(self, query):
#     def post(self, query, data=None):
#     def cursor(self):
#     def _connected(self):
#     def __getstate__(self):
#     def __setstate__(self, state):


import json
import os
import pickle
import unittest
import mysql.connector as mysql
from lib import database
    def test_get_empty(self):
        # Arrange
        query = 'SELECT id, name FROM projects WHERE id = 111111111'

        # Act
        self.database.connect()
        actual = self.database.get(query)

        # Assert
        self.assertIsNone(actual)

    def test_get_single(self):
        # Arrange
        query = 'SELECT id, name FROM projects WHERE id = 1'
        expected = (1, 'ruote-kit')

        # Act
        self.database.connect()
        actual = self.database.get(query)

        # Assert
        self.assertCountEqual(expected, actual)

    def test_get_multiple(self):
        # Arrange
        query = 'SELECT id, name FROM projects WHERE id IN (1,2)'
        expected = [(1, 'ruote-kit'), (2, 'ruote-kit')]

        # Act
        self.database.connect()

# Path: lib/database.py
# class DatabaseError(Exception):
# class Database(object):
#     def __init__(self, value):
#     def __str__(self):
#     def __init__(self, settings):
#     def connect(self):
#     def disconnect(self):
#     def get(self, query):
#     def post(self, query, data=None):
#     def cursor(self):
#     def _connected(self):
#     def __getstate__(self):
#     def __setstate__(self, state):


# Path: tests/test_database.py
import json
import os
import pickle
import unittest
import mysql.connector as mysql
from lib import database

    def test_get_empty(self):
        # Arrange
        query = 'SELECT id, name FROM projects WHERE id = 111111111'

        # Act
        self.database.connect()
        actual = self.database.get(query)

        # Assert
        self.assertIsNone(actual)

    def test_get_single(self):
        # Arrange
        query = 'SELECT id, name FROM projects WHERE id = 1'
        expected = (1, 'ruote-kit')

        # Act
        self.database.connect()
        actual = self.database.get(query)

        # Assert
        self.assertCountEqual(expected, actual)

    def test_get_multiple(self):
        # Arrange
        query = 'SELECT id, name FROM projects WHERE id IN (1,2)'
        expected = [(1, 'ruote-kit'), (2, 'ruote-kit')]

        # Act
        self.database.connect()

        actual = self.database.get(query)