File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def test_create_procfs_report_from_csv_with_one_lines_create_an_procfs_report():
9696 assert isinstance (report , ProcfsReport )
9797
9898
99- def test_create_procfs_report_from_csv_with_bad_timestamp_format_raise_BadInputData ():
99+ def test_create_procfs_report_from_csv_with_good_timestamp_format ():
100100 csv_lines = [("procfs" ,
101101 {
102102 "timestamp" : "2021-09-14T123737.669237" ,
@@ -113,6 +113,26 @@ def test_create_procfs_report_from_csv_with_bad_timestamp_format_raise_BadInputD
113113 }
114114 )
115115 ]
116+ report = ProcfsReport .from_csv_lines (csv_lines )
117+ assert isinstance (report , ProcfsReport )
118+
119+ def test_create_procfs_report_from_csv_with_good_timestamp_format_raise_BadInputData ():
120+ csv_lines = [("procfs" ,
121+ {
122+ "timestamp" : "2021-09-14T1234737.669237" ,
123+ "sensor" : "formula_group" ,
124+ "target" : ["firefox_cgroup" , "emacs_cgroup" ,
125+ "zsh_cgroup" , "mongo_cgroup" ],
126+ "usage" : {
127+ "firefox_cgroup" : 8.36 ,
128+ "emacs_cgroup" : 5.52 ,
129+ "zsh_cgroup" : 0.01 ,
130+ "mongo_cgroup" : 0.64 ,
131+ },
132+ "global_cpu_usage" : 27.600000000000012 ,
133+ }
134+ )
135+ ]
116136 with pytest .raises (BadInputData ):
117137 _ = ProcfsReport .from_csv_lines (csv_lines )
118138
You can’t perform that action at this time.
0 commit comments