# Path: philharmonic/simulator/environment.py
# class Environment(object):
#     """provides data about all the data centers
#     - e.g. the temperature and prices at different location
# 
#     """
#     def __init__(self):
#         pass
# 
#     def __repr__(self):
#         return repr({'start': self.start, 'end': self.end,
#                      'period': self.period,
#                      '_forecast_periods': self._forecast_periods})
# 
#     def current_data(self):
#         """return all the current data for all the locations"""
#         raise NotImplemented


import unittest
import pandas as pd
from mock import Mock, MagicMock
from nose.tools import *
from philharmonic import *
from philharmonic.simulator.environment import Environment
    assert_true(
        (schedule2.actions == pd.Series({t1: a1, t2: a2, t3: a3})).all()
    )

def test_schedule_add_first_replaced():
    vm1 = VM(2000, 1);
    s1 = Server(5000, 2);
    s2 = Server(5000, 2);
    a1 = Migration(vm1, s1)
    a2 = Migration(vm1, s2)
    t1 = pd.datetime.now()
    a3 = Migration(vm1, s2)
    t2 = t1 + pd.offsets.Hour(1)
    schedule = Schedule()
    schedule.add(a1, t1)
    schedule.add(a2, t1)
    schedule.add(a3, t2)
    expected = pd.Series([a1, a2, a3], index=[t1, t1, t2])
    assert_true((schedule.actions == expected).all())

def test_schedule_add_existing():
    vm1 = VM(2000, 1);
    s1 = Server(5000, 2);
    s2 = Server(5000, 2);
    a1 = Migration(vm1, s1)
    t1 = pd.Timestamp('2002-01-01 03:00')
    a2 = Migration(vm1, s2)
    a3 = Migration(vm1, s2)
    t2 = t1 + pd.offsets.Hour(1)
    schedule = Schedule()

# Path: philharmonic/simulator/environment.py
# class Environment(object):
#     """provides data about all the data centers
#     - e.g. the temperature and prices at different location
# 
#     """
#     def __init__(self):
#         pass
# 
#     def __repr__(self):
#         return repr({'start': self.start, 'end': self.end,
#                      'period': self.period,
#                      '_forecast_periods': self._forecast_periods})
# 
#     def current_data(self):
#         """return all the current data for all the locations"""
#         raise NotImplemented


# Path: philharmonic/cloud/tests/test_model.py
import unittest
import pandas as pd
from mock import Mock, MagicMock
from nose.tools import *
from philharmonic import *
from philharmonic.simulator.environment import Environment

    assert_true(
        (schedule2.actions == pd.Series({t1: a1, t2: a2, t3: a3})).all()
    )

def test_schedule_add_first_replaced():
    vm1 = VM(2000, 1);
    s1 = Server(5000, 2);
    s2 = Server(5000, 2);
    a1 = Migration(vm1, s1)
    a2 = Migration(vm1, s2)
    t1 = pd.datetime.now()
    a3 = Migration(vm1, s2)
    t2 = t1 + pd.offsets.Hour(1)
    schedule = Schedule()
    schedule.add(a1, t1)
    schedule.add(a2, t1)
    schedule.add(a3, t2)
    expected = pd.Series([a1, a2, a3], index=[t1, t1, t2])
    assert_true((schedule.actions == expected).all())

def test_schedule_add_existing():
    vm1 = VM(2000, 1);
    s1 = Server(5000, 2);
    s2 = Server(5000, 2);
    a1 = Migration(vm1, s1)
    t1 = pd.Timestamp('2002-01-01 03:00')
    a2 = Migration(vm1, s2)
    a3 = Migration(vm1, s2)
    t2 = t1 + pd.offsets.Hour(1)
    schedule = Schedule()

    schedule.environment = Environment()