54 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
082c5ee1ce
networks: Minor trimming to tests
- To focus only on what is being tested.
2016-02-09 09:35:14 +05:30
James Valleroy
1851b15836
networks: Fix tests, move settings to a dict 2016-02-09 09:35:01 +05:30
Sunil Mohan Adapa
a48068f775
Ability to localize brand name in templates
- Take the value from the configuration and run it throught the Django
  translate method and make it available in Context.

- Use a no-op translate method to translate the text 'FreedomBox'.
2016-01-24 00:22:26 +05:30
Sunil Mohan Adapa
0280d22c12 networks: Update tests for setting manual address 2015-12-23 10:09:49 +05:30
James Valleroy
1927eac06c Update network tests to work with added parameters. 2015-12-22 16:21:45 -05:00
Sunil Mohan Adapa
34ba546d9d config: Simplify tests
- Using the new configuration module changes meant for easy tests,
  simplify all test cases.

- Reading file is tested separately from find the configuration file.
2015-12-05 09:51:50 -05:00
Sunil Mohan Adapa
bbef41af7a Fix missing option in test configuration
Add danube_edition option to the Misc section of the configuration file.
Without this option, this 'missing section' test case will fail with
'missing option' instead of 'missing section'.  Coupled with the
unpredictable order of reading options, this only happens sometimes.
2015-12-05 09:51:50 -05:00
fonfon
125cb88336 Removed cfg.product_name entry and tests
The name 'Plinth' (cfg.product_name) is not used anymore after my previous
commits.
Reason for the complete removal: I do not think that users should know or have
to care about the internal name of the web interface of the FreedomBox.
2015-10-28 19:52:14 -04:00
Sunil Mohan Adapa
45fd4f2a53 Cleanup casting from values in cfg 2015-09-29 22:50:02 +05:30
fonfon
3d87c3eb3b Data types for cfg.py; add danube_edition entry
- Explicitly state datatype in config_items to handle them more
  generically

- Handle boolean values correctly.  Before this fix we got the string
  'False' which evaluated to True (this affected the entry
  'use_x_forwarded_host').

- Add the config entry 'danube_edition'. Activating it shows a voucher
  input field for pagekite accounts on freedombox.me during the
  firstboot process. Other vouchers (i.e. for VPN services) might
  follow.  Add description and test for 'danube_edition' setting.
2015-09-29 09:11:18 +05:30
Sunil Mohan Adapa
1e10fb76fc networks: Add test case for PPPoE
- Update ethernet and Wi-Fi tests to make sure interface name is
  properly set.
2015-08-22 20:18:51 +05:30
James Valleroy
e060960fed Also add IPv4 manual address test for wifi. 2015-07-29 22:29:01 -04:00
James Valleroy
110d50d7e2 Make separate network test for IPv4 manual address. 2015-07-29 21:56:24 -04:00
James Valleroy
6c06799320 Specify interfaces for network tests where needed. 2015-07-29 21:38:20 -04:00
Bob Girard
d64ce6cc01 Bundle tests with applications
- For each application, add ./tests directory and __init__.py file
  within it.

- Modify test controllers (coverage.py, runtests.py) to find the new
  test directories for testing and coverage analysis.

- Move existing application-specific test modules (test_pagekite.py) to
  the newly created directories.
2015-06-26 12:05:48 +05:30
Sunil Mohan Adapa
393095db4e xmpp: Remove special handling for empty arguments
- As tested in the updated test case, subprocess module can send empty
  arguments properly to the invoked commands.  No special handling is
  necessary.
2015-05-26 16:10:54 +05:30
Sunil Mohan Adapa
cf1bb65a0c tests: Minor styling fixes and updates
- Add module level comments.

- Add comments to reflect docstring styling.

- Since most tests can no longer be run directly, remove __main__
  invocation uniformly from all the tests.

- Remove unnecessary test settings and let them take default values.

- Add license header to test settings module.

- Fix a minor issue actions test tear down.

- Improve key/value store tests.
2015-05-24 12:16:51 +05:30
Bob Girard
c16bff7fec Add plinth/tests/data/__init__.py to fix ImportError 2015-05-23 13:59:49 +05:30
Bob Girard
5cadd223d5 Add support for testing Django-dependent modules
- Add django-test-settings.py for Django settings
- Add runtests.py for setting up Django test environment
- Add Django test setup support to setup.py and coverage.py
- Add new test module test_kvstore.py
- Enable existing Django-dependent tests in test_context_processors.py and test_menu.py
2015-05-23 13:59:49 +05:30
James Valleroy
b00a634647 Update network tests, minor fixes to network.py.
Return UUID when adding a connection.
Have get_connection raise an exception instead of returning None.
2015-05-16 15:39:26 -04:00
fonfon
5cca1f99cf removed/skipped deprecated unit-test 2015-05-04 10:52:29 +02:00
fonfon
4561c3bcd9 Removed quote-checking functionality from pagekite
actions.py doesn't use shlex.quote anymore so I don't
have to check for accidentially quoted things anymore.
2015-05-03 19:27:12 +02:00
fonfon
7af92d9e65 Updated unit- and doctests 2015-05-03 19:27:12 +02:00
fonfon
ef08f40447 minor layout cleanup 2015-05-03 15:28:45 +02:00
fonfon
e0fa113a9c updated tests 2015-05-03 09:44:46 +02:00
fonfon
1fc0064fd0 refactoring pagekite: configuration form works
splitting the services to a separate page is not yet finished
2015-05-03 09:44:46 +02:00
Sunil Mohan Adapa
b62f6746f4 Handle arguments to actions properly
- Don't allow strings to be sent as arguments.  The mixup with
  lists/tuples could be dangerous.

- Don't escape arguments.  subprocess.Popen takes care that arguments
  are passed on nicely to the actions.

- Update tests.
2015-05-01 18:52:17 +05:30
Sunil Mohan Adapa
13e0707b09 network: Skip network tests when running as non-root 2015-04-06 23:11:26 +05:30
Sunil Mohan Adapa
f00f65f484 network: Update tests to work with UUIDs and add a few more checks 2015-04-06 22:21:29 +05:30
James Valleroy
2441caf647 Add AP and adhoc wifi modes, and shared IPv4 addressing mode. 2015-04-06 22:21:29 +05:30
James Valleroy
8d9b388375 Fix network tests, add form help and validator. 2015-04-06 22:21:29 +05:30
James Valleroy
9b201a2daf Rename network module to networks.
Move networkmanager helper functions into a new file.
Add some network tests.
2015-04-06 22:21:28 +05:30
Bob Girard
c7a8bcbd17 Skip tests for now requiring Django configuration
Tests pass locally, but not in Travis-CI. Tests will
be re-enabled when Django configuration is added.
2015-04-01 23:07:12 -07:00
Bob Girard
41d6cae0a9 Enable integration of Plinth with Travis-CI
- Add files .travis.yml and requirements.txt
- In setup.py, remove 'pygobject' from install_requires
- In setup.py, add 'pyyaml' to install_requires
- Add file plinth/tests/coverage/__init__.py
- Rename file plinth/tests/coverage/test_coverage.py to coverage.py
- In plinth/tests/coverage/coverage.py, rename class TestCoverageCommand
  to CoverageCommand
2015-04-01 16:12:59 -07:00
Bob Girard
15161e10b1 Eliminate renaming plinth.config file for tests
- Instead of renaming plinth.config, make a copy and run all feasible
  tests on the copy, then delete the copy.
2015-02-13 11:33:35 -07:00
Sunil Mohan Adapa
e69b500247 Add to context processor and menu test cases
- Minor style updates to other tests
2015-01-30 18:11:37 +05:30
Bob Girard
f184c23c31 Add unit tests (#1)
* Add unit tests for cfg.py, context_processors.py, and menu.py
* Add new plinth/tests/data directory for miscellaneous test data
* In cfg.py, add an explicit check to verify the existence of the secondary
  (non-default) plinth.config file
* In cfg.py, replace deprecated configparser.SafeConfigParser with
  configparser.ConfigParser
2015-01-30 18:11:36 +05:30
Bob Girard
c72c03890c Add detailed test coverage console report
* Add a detailed console report to the 'test_coverage' command output
* Expand the precision of all coverage percentages to two decimal places
* Print the location of the HTML coverage report at the end of the console report
2015-01-25 10:52:44 +05:30
fonfon
ae83566653 removed unused 'title' from subsubmenus 2014-12-15 15:54:40 +01:00
Sunil Mohan Adapa
10496d89a5 Refactor templatetags and tests for styling 2014-12-14 08:51:13 +05:30
fonfon
97fe5714e2 Fix subsubmenu highlighting bug and add tests 2014-12-09 23:32:06 +01:00
Sunil Mohan Adapa
733a4fd139 Minor styling fixes for test coverage script 2014-12-07 11:39:38 +05:30
Sunil Mohan Adapa
5016087d5c Move coverage to test dependency and install it properly
- Coverage should only be required if running tests

- When running test_coverage command all the install dependencies and
  test dependencies should be installed.
2014-12-07 11:38:33 +05:30
Sunil Mohan Adapa
a0cd525b96 Add explicit license from test coverage script
The license on the blog post is GPLv3+.  The derived work can't be of
any other license but GPLv3+.
2014-12-07 11:33:10 +05:30
Sunil Mohan Adapa
3444d5e314 Don't fail setup.py when without coverage module 2014-12-07 11:10:37 +05:30
fonfon
ff36dd1010 print coverage at the end of the test; minor pep8 fixes 2014-12-07 10:40:51 +05:30
Bob Girard
a502da63d5 Add test coverage measurement and reporting
- Implement coverage functionality as a setuptools Command subclass
  (in plinth/tests/coverage/test_coverage.py)
- Register the new 'test_coverage' command in setup.py
- Modify the INSTALL file to specify python3-coverage as a new dependency
- Modify the HACKING file to document the new 'test_coverage' command
- Have git (via .gitignore) ignore the '.coverage' output data file and
  the contents of the 'plinth/tests/coverage/report' directory
2014-12-06 18:14:42 +05:30
Sunil Mohan Adapa
5b969d9d30 Explicitly write license headers for each source file
The package license (AGPL3+) implicitly indicates the license of each
file.  However, it is desirable to have license headers in each file.
This is the case for many prominent projects like GNU project, Mozilla
etc.
2014-11-30 14:49:49 +05:30
Sunil Mohan Adapa
c9d8bb9d00 Require and use Python3 2014-10-01 11:31:51 +05:30
Sunil Mohan Adapa
4cc2dc4546 Launch test cases using "setup.py test" 2014-08-31 14:24:00 +05:30