# Path: logic/department.py
# def get_all_departments():
#     return sorted(
#         [
#             row.department
#             for row in Employee.query(projection=['department'], distinct=True).fetch()
#             if row.department
#         ],
#     )
# 
# Path: testing/factories/employee.py
# def create_employee(
#     username='johndoe',
#     department='Engineering',
#     first_name='John',
#     last_name='Doe',
#     photo_url=None,
#     office=None,
# ):
# 
#     if photo_url is None:
#         photo_url = 'http://example.com/photos/{0}.jpg'.format(username)
# 
#     return Employee.create_from_dict({
#         'username': username,
#         'department': department,
#         'first_name': first_name,
#         'last_name': last_name,
#         'photo_url': photo_url,
#         'office': office,
#     })


import unittest
from logic.department import get_all_departments
from testing.factories import create_employee
# -*- coding: utf-8 -*-



DEPARTMENTS = [
    'Department 1',
    'Department 2',
    'Department 3',
    'Department 4',
    'Department 4',
    'Department 5',
]


class DepartmentTest(unittest.TestCase):
    # enable the datastore stub
    nosegae_datastore_v3 = True

    def test_get_all_departments(self):
        for department in DEPARTMENTS:

# Path: logic/department.py
# def get_all_departments():
#     return sorted(
#         [
#             row.department
#             for row in Employee.query(projection=['department'], distinct=True).fetch()
#             if row.department
#         ],
#     )
# 
# Path: testing/factories/employee.py
# def create_employee(
#     username='johndoe',
#     department='Engineering',
#     first_name='John',
#     last_name='Doe',
#     photo_url=None,
#     office=None,
# ):
# 
#     if photo_url is None:
#         photo_url = 'http://example.com/photos/{0}.jpg'.format(username)
# 
#     return Employee.create_from_dict({
#         'username': username,
#         'department': department,
#         'first_name': first_name,
#         'last_name': last_name,
#         'photo_url': photo_url,
#         'office': office,
#     })


# Path: tests/logic/department_test.py
import unittest
from logic.department import get_all_departments
from testing.factories import create_employee

# -*- coding: utf-8 -*-



DEPARTMENTS = [
    'Department 1',
    'Department 2',
    'Department 3',
    'Department 4',
    'Department 4',
    'Department 5',
]


class DepartmentTest(unittest.TestCase):
    # enable the datastore stub
    nosegae_datastore_v3 = True

    def test_get_all_departments(self):
        for department in DEPARTMENTS:

            create_employee(department=department, username='{}-{}'.format('username', department))