Readme
manhar336 / office-scripts Goto Github PK
View Code? Open in Web Editor NEWReadme
Readme
testing
// , Write a test!
unittest is the batteries-included test module in the Python standard library. Its API will be familiar to anyone who has used any of the JUnit/nUnit/CppUnit series of tools.
Creating test cases is accomplished by subclassing unittest.TestCase.
import unittest
def fun(x): return x + 1 class MyTest(unittest.TestCase): def test(self): self.assertEqual(fun(3), 4)
-- http://docs.python-guide.org/en/latest/writing/tests/#the-basic
In this case, you would make a function like this:
In one file, hello_world.py, make this:
#!/usr/bin/env python3
def hello_world():
return 'Hello, world!'
#Test:
print ( hello_world() ) # If it prints Hello, world! then this program is working correctly.
If you feel strong and ambitious, try a more advanced test, perhaps.
In another file, test_hello_world.py
, make a test like this:
import hello_world
import unittest # More details: https://docs.python.org/3/library/unittest.html
class TestHelloWorld(unittest.TestCase):
def test_hello_world(self):
self.assertEqual('Hello, world!', hello_world()) # For other programs, there are assertTrue() or assertFalse() to verify a condition; or assertRaises() to check an exception
if __name__ == '__main__':
unittest.main()
// , Merge the working, tested code into the Master branch!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.