Skip to content

Commit

Permalink
Python Jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jul 15, 2021
0 parents commit 7e24a1f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
Binary file added __pycache__/account.cpython-36.pyc
Binary file not shown.
10 changes: 10 additions & 0 deletions account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class account:
def check_password_length(self, password):
if len(password) > 8:
return True
else:
return False

if __name__ == '__main__':
accVerify = account()
print('The password length is ' + str(accVerify.check_password_length('offtoschool')))
17 changes: 17 additions & 0 deletions account_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import unittest
import account as AccountClass

class Test(unittest.TestCase):
accInfo = AccountClass.account()

def test_check_password_length(self):
print("Checking possible passwords\n")
passwordList = [ 'abeautifulday', 'astrictboss', 'alovelyhouse' ]

for passwd in passwordList:
print("Checking password " + passwd + "\n")
passInfo = self.accInfo.check_password_length(passwd)
self.assertTrue(passInfo)

if __name__ == '__main__':
unittest.main()
5 changes: 5 additions & 0 deletions api_commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
curl -s 'http://localhost:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)' -u admin:admin

curl -s -XPOST 'http://localhost:8080/createItem?name=python-project-new' -u admin:admin --data-binary @config.xml -H "Jenkins-Crumb:384576fea44a8984fd1afe2474c8e951" -H "Content-Type:text/xml"

curl -s -XPOST 'http://localhost:8080/reload' -u admin:admin -H "Jenkins-Crumb:aacc27914e1ef26b82e8930ec44ce944"
14 changes: 14 additions & 0 deletions xml_to_add_to_job
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<publishers>
<hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup@0.34">
<patterns class="empty-list"/>
<deleteDirs>true</deleteDirs>
<skipWhenFailed>false</skipWhenFailed>
<cleanWhenSuccess>true</cleanWhenSuccess>
<cleanWhenUnstable>true</cleanWhenUnstable>
<cleanWhenFailure>true</cleanWhenFailure>
<cleanWhenNotBuilt>true</cleanWhenNotBuilt>
<cleanWhenAborted>true</cleanWhenAborted>
<notFailBuild>false</notFailBuild>
<cleanupMatrixParent>false</cleanupMatrixParent>
<externalDelete></externalDelete>
</hudson.plugins.ws__cleanup.WsCleanup>

0 comments on commit 7e24a1f

Please sign in to comment.