New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing test in the python. #92

Closed
joereddington-public opened this Issue Aug 8, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@joereddington-public

joereddington-public commented Aug 8, 2018

Summary

Test failing in production branch

Steps to reproduce

Run

python test_grab_text.py ovfTest.test_create_obf_object

in the 'tests' directory of the repo.

Expected Results

The obj object produced by these lines:

    grids = self.get_singleton_CK20().grids
    obf=grab_text.create_obf_object(grids[0])

Should match this file (when unzipped).
singleobffile.obf.zip

Actual Results

It does not. The issue appears to be a difference in quotation marks. (running opendiff temp.json ../testoutputs/singleobffile.obf after testing only this case)

screen shot 2018-08-21 at 08 10 42

@greg-westnine

This comment has been minimized.

Show comment
Hide comment
@greg-westnine

greg-westnine Aug 9, 2018

Collaborator

@joereddington if we are following the policy, this is a bug, and should have that label. It should say what the bug is, ie expected behaviour and actual behaviour.

Collaborator

greg-westnine commented Aug 9, 2018

@joereddington if we are following the policy, this is a bug, and should have that label. It should say what the bug is, ie expected behaviour and actual behaviour.

@joereddington joereddington added the bug label Aug 10, 2018

@joereddington-public

This comment has been minimized.

Show comment
Hide comment
@joereddington-public

joereddington-public Aug 21, 2018

  • Okay, first todo item is check what OBF actually wants - is it single or double quotes?

  • From SE "As per the API documentation, double quotes are considered valid JSON, single quotes aren't."

  • We should do a bit more work and check that obf wants to be valid json...

08:16:

It does!

{
  "format": "open-board-0.1",
  "id": "simple",
  "locale": "en",
  "name": "Simple Board",
  "description_html": "This is a very basic .obf file, it contains no images or sounds, and assumes default styling.",
  "grid": {
    "rows": 2,
    "columns": 2,
    "order": [
      [1, 2],
      [null, null]
    ]
  },

08:21:

It still doesn't match up because of some unicode string, but I've taken a different path - I've used http://www.openboardformat.org/tools to look at the file as generated and checked it by hand - it comes up fine, so I'm using that. I realise I'm changing the test to fit the code, but in the circumstances I'm fine with that.
screen shot 2018-08-21 at 08 21 16

joereddington-public commented Aug 21, 2018

  • Okay, first todo item is check what OBF actually wants - is it single or double quotes?

  • From SE "As per the API documentation, double quotes are considered valid JSON, single quotes aren't."

  • We should do a bit more work and check that obf wants to be valid json...

08:16:

It does!

{
  "format": "open-board-0.1",
  "id": "simple",
  "locale": "en",
  "name": "Simple Board",
  "description_html": "This is a very basic .obf file, it contains no images or sounds, and assumes default styling.",
  "grid": {
    "rows": 2,
    "columns": 2,
    "order": [
      [1, 2],
      [null, null]
    ]
  },

08:21:

It still doesn't match up because of some unicode string, but I've taken a different path - I've used http://www.openboardformat.org/tools to look at the file as generated and checked it by hand - it comes up fine, so I'm using that. I realise I'm changing the test to fit the code, but in the circumstances I'm fine with that.
screen shot 2018-08-21 at 08 21 16

joereddington-public pushed a commit to joereddington-public/TheOpenVoiceFactory that referenced this issue Aug 21, 2018

Joe Public Joe Public
Test test_create_obf_object is now passing (fixes eQualityTime#92). I…
… changed the test rather than the code, because the code checked out according to the open board format tools.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment