<commit_before>from django.test import TestCase, SimpleTestCase

from .decorators import (
    _check_general_token_issues,
    _check_oauth_token_issues,
    _check_temp_token_issues,
    _get_last_modified_header,
    how_many_seconds_until_midnight,
    get_var,
    throttle_api_call,
    UclApiIncorrectTokenTypeException
)

from .helpers import (
    generate_api_token,
    PrettyJsonResponse as JsonResponse,
    RateLimitHttpResponse as HttpResponse
)

from dashboard.models import (
    App,
    User
)

from dashboard.app_helpers import get_temp_token, generate_temp_api_token

from oauth.models import OAuthToken, OAuthScope
from oauth.scoping import Scopes

from freezegun import freeze_time
from rest_framework.test import APIRequestFactory

from uclapi.settings import REDIS_UCLAPI_HOST

import datetime
import json
import redis
import time


class SecondsUntilMidnightTestCase(SimpleTestCase):
    def test_seconds_until_midnight(self):
        arg_list = [
            "2017-05-29 23:59:59",
            "2017-05-29 00:00:00",
            "2017-05-29 00:00:01"
        ]

        expected = [
            1,
            0,<commit_msg>Reverted unchanged files to master<commit_after>from django.test import TestCase, SimpleTestCase

from .decorators import (
    _check_general_token_issues,
    _check_oauth_token_issues,
    _check_temp_token_issues,
    _get_last_modified_header,
    how_many_seconds_until_midnight,
    get_var,
    throttle_api_call,
    UclApiIncorrectTokenTypeException
)

from .helpers import (
    generate_api_token,
    PrettyJsonResponse as JsonResponse,
    RateLimitHttpResponse as HttpResponse
)

from dashboard.models import (
    App,
    User
)

from dashboard.app_helpers import get_temp_token, generate_temp_api_token

from oauth.models import OAuthToken, OAuthScope
from oauth.scoping import Scopes

from freezegun import freeze_time
from rest_framework.test import APIRequestFactory

from uclapi.settings import REDIS_UCLAPI_HOST

import datetime
import json
import redis
import time

class SecondsUntilMidnightTestCase(SimpleTestCase):
    def test_seconds_until_midnight(self):
        arg_list = [
            "2017-05-29 23:59:59",
            "2017-05-29 00:00:00",
            "2017-05-29 00:00:01"
        ]

        expected = [
            1,
            0,
{'fraction_non_alphanumeric': 0.05512489233419466, 'fraction_numerical': 0.03789836347975883, 'mean_word_length': 3.519455252918288, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1439473', 'n_tokens_mistral': 785, 'n_tokens_neox': 722, 'n_words': 161}