Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Twint
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Twint
Commits
c0886a47
Commit
c0886a47
authored
Jun 02, 2018
by
Cody Zacharias
Committed by
GitHub
Jun 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create test.py
parent
6417e843
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
test.py
test.py
+84
-0
No files found.
test.py
0 → 100644
View file @
c0886a47
import
twint
import
os
'''
Test.py - Testing TWINT to make sure everything works.
'''
def
test_reg
(
c
,
run
):
print
(
"[+] Beginning vanilla test in {}"
.
format
(
str
(
run
)))
run
(
c
)
def
test_db
(
c
,
run
):
print
(
"[+] Beginning DB test in {}"
.
format
(
str
(
run
)))
c
.
Database
=
"test_twint.db"
run
(
c
)
def
custom
(
c
,
run
,
_type
):
print
(
"[+] Beginning custom {} test in {}"
.
format
(
_type
,
str
(
run
)))
c
.
Custom
=
[
"id"
,
"username"
]
run
(
c
)
def
test_json
(
c
,
run
):
c
.
Store_json
=
True
c
.
Output
=
"test_twint.json"
custom
(
c
,
run
,
"JSON"
)
print
(
"[+] Beginning JSON test in {}"
.
format
(
str
(
run
)))
run
(
c
)
def
test_csv
(
c
,
run
):
c
.
Store_csv
=
True
c
.
Output
=
"test_twint.csv"
custom
(
c
,
run
,
"CSV"
)
print
(
"[+] Beginning CSV test in {}"
.
format
(
str
(
run
)))
run
(
c
)
def
main
():
c
=
twint
.
Config
()
c
.
Username
=
"verified"
c
.
Limit
=
20
c
.
Store_object
=
True
# Seperate objects are neccessary.
f
=
twint
.
Config
()
f
.
Username
=
"verified"
f
.
Limit
=
20
f
.
Store_object
=
True
f
.
User_full
=
True
runs
=
[
twint
.
run
.
Following
,
twint
.
run
.
Followers
,
twint
.
run
.
Search
,
twint
.
run
.
Profile
,
twint
.
run
.
Favorites
]
tests
=
[
test_reg
,
test_json
,
test_csv
,
test_db
]
# Something breaks if we don't split these up
for
run
in
runs
[:
2
]:
for
test
in
tests
:
test
(
f
,
run
)
for
run
in
runs
[
2
:]:
if
run
==
twint
.
run
.
Search
:
c
.
Since
=
"2012-1-1"
c
.
Until
=
"2017-1-1"
else
:
c
.
Since
=
""
c
.
Until
=
""
for
test
in
tests
:
test
(
c
,
run
)
files
=
[
"test_twint.db"
,
"test_twint.json"
,
"test_twint.csv"
]
for
_file
in
files
:
os
.
remove
(
_file
)
print
(
"[+] Testing complete!"
)
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment