# Path: app/gates.py
# def generate_info(config):
# def test_against_global_rules(rules, env, lt):
# def are_gates_open(config, env):
# def gate_is_closed(entry, config, env, ticket_id=None):
# def gate_is_manually_closed(entry, env):
# 
# Path: tests/helpers/database_helper.py
# class DatabaseHelper:
#     def __init__(self, environment):
#         config_loader = ConfigLoader(verify=False)
#         self.config = config_loader.load_config("resources/", environment)
#         self.mongo = MongoConnect(self.config)
#         state.mongo = self.mongo
# 
#     def decrease_ticket_expiration_date_by(self, ticket_id, delta):
#         self.mongo.update_ticket(ticket_id, {"expiration_date": self.mongo.get_expiration_date(delta)})
# 
#     def create_holiday(self, days_offset, reason, environments):
#         mongo = MongoConnect(self.config)
#         mongo.add_holiday({
#             'date': (datetime.now() + timedelta(days=days_offset)).strftime('%Y-%m-%d'),
#             'reason': reason,
#             'environments': environments
#         })
# 
#     def clear_database(self):
#         mongo = MongoConnect(self.config)
#         mongo.collection.drop()
#         mongo.tickets.drop()
#         mongo.holidays.drop()


import unittest
from app import gates
from tests.helpers.database_helper import DatabaseHelper


test_rules = {
    "live": {
        "no_restriction": {

# Path: app/gates.py
# def generate_info(config):
# def test_against_global_rules(rules, env, lt):
# def are_gates_open(config, env):
# def gate_is_closed(entry, config, env, ticket_id=None):
# def gate_is_manually_closed(entry, env):
# 
# Path: tests/helpers/database_helper.py
# class DatabaseHelper:
#     def __init__(self, environment):
#         config_loader = ConfigLoader(verify=False)
#         self.config = config_loader.load_config("resources/", environment)
#         self.mongo = MongoConnect(self.config)
#         state.mongo = self.mongo
# 
#     def decrease_ticket_expiration_date_by(self, ticket_id, delta):
#         self.mongo.update_ticket(ticket_id, {"expiration_date": self.mongo.get_expiration_date(delta)})
# 
#     def create_holiday(self, days_offset, reason, environments):
#         mongo = MongoConnect(self.config)
#         mongo.add_holiday({
#             'date': (datetime.now() + timedelta(days=days_offset)).strftime('%Y-%m-%d'),
#             'reason': reason,
#             'environments': environments
#         })
# 
#     def clear_database(self):
#         mongo = MongoConnect(self.config)
#         mongo.collection.drop()
#         mongo.tickets.drop()
#         mongo.holidays.drop()


# Path: tests/test_gates.py
import unittest
from app import gates
from tests.helpers.database_helper import DatabaseHelper



test_rules = {
    "live": {
        "no_restriction": {

            "hours_range": [0, 24],