FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pyt/tests/github_search_test.py at 8githubScanRefactor · python-security/pyt · GitHub
python-security
pyt
Repository navigation
Code
Issues
26
(26)
Pull requests
2
(2)
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
pyt
/
tests
/
github_search_test.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
47 lines (35 loc) · 1.6 KB
Breadcrumbs
pyt
/
tests
/
github_search_test.py
Copy path
File metadata and controls
47 lines (35 loc) · 1.6 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import
unittest
from
datetime
import
date
from
pyt
.
github_search
import
get_dates
,
scan_github
,
set_github_api_token
from
pyt
.
__main__
import
analyse_repo
from
pyt
.
reaching_definitions_taint
import
ReachingDefinitionsTaintAnalysis
class
TestGetDates
(
unittest
.
TestCase
):
def
assertDateTuple
(
self
,
dateInterval
,
expectedStart
,
expectedEnd
):
self
.
assertEqual
(
dateInterval
[
0
],
expectedStart
)
self
.
assertEqual
(
dateInterval
[
1
],
expectedEnd
)
def
test_range_shorter_than_interval
(
self
):
date_range
=
get_dates
(
date
(
2016
,
12
,
12
),
date
(
2016
,
12
,
13
),
7
)
date_range
=
list
(
date_range
)
self
.
assertDateTuple
(
date_range
[
0
],
date
(
2016
,
12
,
12
),
date
(
2016
,
12
,
13
))
def
test_range_longer_than_interval
(
self
):
date_range
=
get_dates
(
date
(
2016
,
12
,
12
),
date
(
2016
,
12
,
16
),
2
)
date_range
=
list
(
date_range
)
self
.
assertDateTuple
(
date_range
[
0
],
date
(
2016
,
12
,
12
),
date
(
2016
,
12
,
13
))
self
.
assertDateTuple
(
date_range
[
1
],
date
(
2016
,
12
,
14
),
date
(
2016
,
12
,
15
))
self
.
assertDateTuple
(
date_range
[
2
],
date
(
2016
,
12
,
16
),
date
(
2016
,
12
,
16
))
class
TestScanGithub
(
unittest
.
TestCase
):
def
test_scan_simple_repo
(
self
):
set_github_api_token
()
scan_github
(
'flask'
,
date
(
2017
,
1
,
1
),
ReachingDefinitionsTaintAnalysis
,
analyse_repo
,
''
)
Back
|
FazBrowse Home
|
New Git URL