# Path: coldsweat/utilities.py
# def datetime_as_epoch(value):
#     return int(timegm(value.utctimetuple()))
# 
# Path: coldsweat/models.py
# class User(CustomModel):
#     """
#     Coldsweat user
#     """    
#     DEFAULT_USERNAME = 'coldsweat' 
#     MIN_PASSWORD_LENGTH = 8
# 
#     username            = CharField(unique=True)
#     password            = CharField()  
#     email               = CharField(default='')
#     api_key             = CharField(unique=True)
#     is_enabled          = BooleanField(default=True) 
# 
#     class Meta:
#         db_table = 'users'
#     
#     @staticmethod
#     def make_api_key(email, password):
#         return make_md5_hash(u'%s:%s' % (email, password))
# 
#     @staticmethod
#     def validate_api_key(api_key):
#         try:
#             # Clients may send api_key in uppercase, lower it
#             user = User.get((User.api_key == api_key.lower()) & 
#                 (User.is_enabled == True))        
#         except User.DoesNotExist:
#             return None
# 
#         return user
# 
#     @staticmethod
#     def validate_credentials(username_or_email, password):        
#         '''Lookup for and existing username/e-mail combo and password'''
#         try:
#             user = User.get(((User.username == username_or_email) | 
#                 (User.email == username_or_email)) & 
#                 (User.is_enabled == True))
#         except User.DoesNotExist:
#             return None
# 
#         # Do a case-sensitive compare
#         if user.password != password:
#             return None
# 
#         return user
#     
#     @staticmethod
#     def validate_password(password):
#         return len(password) >= User.MIN_PASSWORD_LENGTH


import sys, subprocess, optparse
from datetime import datetime
from ..utilities import datetime_as_epoch
from ..models import User
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description: quick & dirty test suite for Fever API implementation

Copyright (c) 2013—2016 Andrea Peltrin
License: MIT (see LICENSE for details)
'''


TEST_USER_CREDENTIALS = 'test@example.com', 'coldsweat'
ALL = 'groups feeds unread_item_ids saved_item_ids favicons items links unread_recently_read mark_item mark_feed mark_group mark_all'.split()

def run_tests(endpoint, suites=ALL):
    """
    Use curl command line utility to run tests
    """


# Path: coldsweat/utilities.py
# def datetime_as_epoch(value):
#     return int(timegm(value.utctimetuple()))
# 
# Path: coldsweat/models.py
# class User(CustomModel):
#     """
#     Coldsweat user
#     """    
#     DEFAULT_USERNAME = 'coldsweat' 
#     MIN_PASSWORD_LENGTH = 8
# 
#     username            = CharField(unique=True)
#     password            = CharField()  
#     email               = CharField(default='')
#     api_key             = CharField(unique=True)
#     is_enabled          = BooleanField(default=True) 
# 
#     class Meta:
#         db_table = 'users'
#     
#     @staticmethod
#     def make_api_key(email, password):
#         return make_md5_hash(u'%s:%s' % (email, password))
# 
#     @staticmethod
#     def validate_api_key(api_key):
#         try:
#             # Clients may send api_key in uppercase, lower it
#             user = User.get((User.api_key == api_key.lower()) & 
#                 (User.is_enabled == True))        
#         except User.DoesNotExist:
#             return None
# 
#         return user
# 
#     @staticmethod
#     def validate_credentials(username_or_email, password):        
#         '''Lookup for and existing username/e-mail combo and password'''
#         try:
#             user = User.get(((User.username == username_or_email) | 
#                 (User.email == username_or_email)) & 
#                 (User.is_enabled == True))
#         except User.DoesNotExist:
#             return None
# 
#         # Do a case-sensitive compare
#         if user.password != password:
#             return None
# 
#         return user
#     
#     @staticmethod
#     def validate_password(password):
#         return len(password) >= User.MIN_PASSWORD_LENGTH


# Path: coldsweat/tests/fever.py
import sys, subprocess, optparse
from datetime import datetime
from ..utilities import datetime_as_epoch
from ..models import User

#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description: quick & dirty test suite for Fever API implementation

Copyright (c) 2013—2016 Andrea Peltrin
License: MIT (see LICENSE for details)
'''


TEST_USER_CREDENTIALS = 'test@example.com', 'coldsweat'
ALL = 'groups feeds unread_item_ids saved_item_ids favicons items links unread_recently_read mark_item mark_feed mark_group mark_all'.split()

def run_tests(endpoint, suites=ALL):
    """
    Use curl command line utility to run tests
    """


    epoch = datetime_as_epoch(datetime.utcnow())