feat: init files
This commit is contained in:
commit
3dc9473341
3
.idea/.gitignore
vendored
Normal file
3
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<settings>
|
||||||
|
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||||
|
<version value="1.0" />
|
||||||
|
</settings>
|
||||||
|
</component>
|
4
.idea/misc.xml
Normal file
4
.idea/misc.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.5 (web-analyze)" project-jdk-type="Python SDK" />
|
||||||
|
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/web-analyze.iml" filepath="$PROJECT_DIR$/.idea/web-analyze.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
10
.idea/web-analyze.iml
Normal file
10
.idea/web-analyze.iml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="PYTHON_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
0
log_analysis_step2.py
Normal file
0
log_analysis_step2.py
Normal file
16
main.py
Normal file
16
main.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# This is a sample Python script.
|
||||||
|
|
||||||
|
# Press Shift+F10 to execute it or replace it with your code.
|
||||||
|
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
|
||||||
|
|
||||||
|
|
||||||
|
def print_hi(name):
|
||||||
|
# Use a breakpoint in the code line below to debug your script.
|
||||||
|
print("Hi, {0}".format(name)) # Press Ctrl+F8 to toggle the breakpoint.
|
||||||
|
|
||||||
|
|
||||||
|
# Press the green button in the gutter to run the script.
|
||||||
|
if __name__ == '__main__':
|
||||||
|
print_hi('PyCharm')
|
||||||
|
|
||||||
|
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
|
0
pretest1.py
Normal file
0
pretest1.py
Normal file
41
test_helper.py
Executable file
41
test_helper.py
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
import hashlib
|
||||||
|
class TestFailure(Exception):
|
||||||
|
pass
|
||||||
|
class PrivateTestFailure(Exception):
|
||||||
|
pass
|
||||||
|
class Test(object):
|
||||||
|
passed = 0
|
||||||
|
numTests = 0
|
||||||
|
failFast = False
|
||||||
|
private = False
|
||||||
|
@classmethod
|
||||||
|
def setFailFast(cls):
|
||||||
|
cls.failFast = True
|
||||||
|
@classmethod
|
||||||
|
def setPrivateMode(cls):
|
||||||
|
cls.private = True
|
||||||
|
@classmethod
|
||||||
|
def assertTrue(cls, result, msg=""):
|
||||||
|
cls.numTests += 1
|
||||||
|
if result == True:
|
||||||
|
cls.passed += 1
|
||||||
|
print ("1 test passed.")
|
||||||
|
else:
|
||||||
|
print ("1 test failed. " + msg)
|
||||||
|
if cls.failFast:
|
||||||
|
if cls.private:
|
||||||
|
raise PrivateTestFailure(msg)
|
||||||
|
else:
|
||||||
|
raise TestFailure(msg)
|
||||||
|
@classmethod
|
||||||
|
def assertEquals(cls, var, val, msg=""):
|
||||||
|
cls.assertTrue(var == val, msg)
|
||||||
|
@classmethod
|
||||||
|
def assertEqualsHashed(cls, var, hashed_val, msg=""):
|
||||||
|
cls.assertEquals(cls._hash(var), hashed_val, msg)
|
||||||
|
@classmethod
|
||||||
|
def printStats(cls):
|
||||||
|
print ("{0} / {1} test(s) passed.".format(cls.passed, cls.numTests))
|
||||||
|
@classmethod
|
||||||
|
def _hash(cls, x):
|
||||||
|
return hashlib.sha1(str(x)).hexdigest()
|
Loading…
Reference in New Issue
Block a user