Skip to main content

Submission correctness tests for spreadsheets

Project description

sheetwhat

Build Status codecov PyPI version Documentation Status FOSSA Status

sheetwhat enables you to write Submission Correctness Tests (SCTs) for interactive Spreadsheet exercises on DataCamp.

Installing

pip install sheetwhat

Demo

Sheetwhat is typically used in a web application, but you can also experiment with its functions on your local machine. SCT functions that fail will throw a TestFail error.

# Setup: make all checking functions available
from sheetwhat.sct_syntax import SCT_CTX
globals().update(SCT_CTX)

# Setup: set up state with student data, solution data and SCT range
from sheetwhat.State import State
from protowhat.Reporter import Reporter
Ex.root_state = State(
    {'values': [["a", "a"]], "formulas": [["=B1"]]},
    {'values': [["b", "b"]], "formulas": [["=B1"]]},
    "A1",
    Reporter()
)

# Experiment interactively with SCTs
# Passes, as formulas at A1 match
Ex().has_equal_formula()

# Fails, as values at A1 do not match
Ex().has_equal_value()

Testing

pip install -r requirements.txt
pip install -e .
pytest

License

FOSSA Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sheetwhat-0.4.0.tar.gz (23.9 kB view details)

Uploaded Source

File details

Details for the file sheetwhat-0.4.0.tar.gz.

File metadata

  • Download URL: sheetwhat-0.4.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for sheetwhat-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2a0f07f817c566f60b25608f1495bd1d8394c5891bf705b168411bbf3142b235
MD5 1728d5a1c4f610b5c8d301ba3e8431e9
BLAKE2b-256 a993b82463b0345542b2ec5422692b4c57ecbed69ae9ef7febe2086057a0d5bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page