Skip to content

Commit

Permalink
Added test for get_max_rpm_for_all_transactions, changed date values …
Browse files Browse the repository at this point in the history
…in test_log to test minute grouping
  • Loading branch information
serputko committed Sep 15, 2017
1 parent 29f3957 commit c7d3af0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 10 additions & 10 deletions tests/test_log.log
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ xx.xxx.xx.xx - - [31/Aug/2017:14:12:13 +0200] "GET /index.php/backend411/sales_o
xx.xxx.xx.xx - - [31/Aug/2017:14:12:13 +0200] "GET /index.php/backend411/sales_order_invoice/new/order_id/5765/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:12:13 +0200] "GET /index.php/backend411/sales_order_invoice/new/order_id/5654/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:12:13 +0200] "GET /index.php/backend411/sales_order_invoice/new/order_id/5687/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:13:13 +0200] "GET /index.php/backend411/sales_order_invoice/new/order_id/5687/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:13:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5623/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:13:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5654/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:13:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5623/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:13:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5642/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:14:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5615/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:14:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5235/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:14:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5654/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:14:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5623/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:14:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5666/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [31/Aug/2017:14:12:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5623/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:12:13 +0200] "GET /index.php/backend411/sales_order_invoice/new/order_id/5687/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:12:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5654/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:12:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5623/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:12:13 +0200] "POST /index.php/backend411/sales_order_invoice/new/order_id/5642/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:13:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5615/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:13:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5235/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:13:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5654/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:13:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5623/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
xx.xxx.xx.xx - - [01/Sep/2017:14:13:13 +0200] "PUT /index.php/backend411/sales_order_invoice/new/order_id/5666/key/282c6b759d364b4d4ef5145169a0809d/ HTTP/1.1" 200 22388 "https://www.grydeguru.dk/index.php/backend411/sales_order/view/order_id/5618/key/0a9df67f2c69e5b439998a6c787e252c/" "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
8 changes: 7 additions & 1 deletion tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_max_rpm_for_each_transaction(self):
dataframe = replace_dynamic_data(data)
max_rpm_for_each_transaction = get_max_rpm_for_each_transaction(group_by_transactions(dataframe))
self.assertEqual(max_rpm_for_each_transaction[transactions[0]], 6)
self.assertEqual(max_rpm_for_each_transaction[transactions[1]], 4)
self.assertEqual(max_rpm_for_each_transaction[transactions[1]], 3)
self.assertEqual(max_rpm_for_each_transaction[transactions[2]], 5)

def test_total_hits_each(self):
Expand All @@ -32,6 +32,12 @@ def test_total_hits(self):
total_hits = get_total_hits(dataframe)
self.assertEqual(total_hits, 16)

def test_max_rpm_for_all_transactions(self):
data = read_log('./tests/test_log.log')
dataframe = replace_dynamic_data(data)
max_rpm_for_all_transactions = get_max_rpm_for_all_transactions(dataframe)
self.assertEqual(max_rpm_for_all_transactions, 7)


if __name__ == '__main__':
unittest.main()

0 comments on commit c7d3af0

Please sign in to comment.