Exemplo n.º 1
0
def need_update_revenue_tests():
    """ test cases """
    print('need_update_revenue_tests:')

    # test for file that does not exist
    filename = 'data/2023/revenue.csv'
    if os.path.exists(filename):
        os.remove(filename)
    need_update_revenue_test(filename, True)

    # test for modtime date is today
    filename = 'data/2023/revenue.csv'
    fetch.update_revenue('2023', filename)
    need_update_revenue_test(filename, False)
    os.remove(filename)
Exemplo n.º 2
0
def update_revenue_test(stock, filename, expect):
    """ test module """
    if fetch.update_revenue(stock, filename) == expect:
        print('pass')
    else:
        print('fail')