Skip to content
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

Added unit test for issue #977. #1112

Merged
merged 2 commits into from May 17, 2021
Merged

Added unit test for issue #977. #1112

merged 2 commits into from May 17, 2021

Conversation

dannmartens
Copy link
Contributor

@dannmartens dannmartens commented Jun 4, 2020

@nicholascar writes: If the tests here pass, it shows that master now addresses #977.

Closes #977

@nicholascar
Copy link
Member

@dannmartens I see the discussion that lead to this PR - thanks for it - but I can't merge it in or all PRs will fail!

Are you planning on fixing the code to pass this test?

@dannmartens
Copy link
Contributor Author

No, I currently do not have the resources to dive into this any deeper.

I created this PR on request by @white-gecko: #977 (comment)

This PR documents the issue, I gather it is not intended for merging at this stage.

@nicholascar
Copy link
Member

OK, well thanks for the PR - yes it is the very best way to document an Issue!

I'll try and put some resources into it as I want all the various, niggling namespace issues gone.

@nicholascar nicholascar added the wontfix This will not be worked on label Aug 27, 2020
@namcsi
Copy link
Contributor

namcsi commented Mar 5, 2021

Hello, I can confirm that URN-based prefixes are still not being serialized into the .ttl format. Is this issue being looked into? I see that this has been labeled wontfix. Are there any plans to resolve this?

@nicholascar
Copy link
Member

@nemesamade this PR points to the issue but provides no indication as to how to solve it. Since the resulting turtle is valid - the ISBN URN is <urn:isbn:1503280780> - I suppose it's only a stylistic issue.

I'm not sure who is motivated to solve this one but if you would like to, we (maintainers) would be happy to review any PRs!

@namcsi
Copy link
Contributor

namcsi commented Mar 5, 2021

@nicholascar Thanks for the status update. I might try and dig in and solve this one if I can find the time then, as it's a rather annoying inconvenience for a project I'm working on.

@nicholascar
Copy link
Member

@nemesamade great, well if you can get close to a solution (i.e. find all the bits) but need a hand, let me know!

@namcsi
Copy link
Contributor

namcsi commented Mar 8, 2021

I've opened a PR (#1274) that addresses and resolves this issue by modifying namespace.py, along with adding some tests for URN namespace handling by compute_qname and turtle serialization. The change didn't break any existing tests and passes the new tests so it should be an easy fix:)

@aucampia
Copy link
Member

These test should maybe be committed with @unittest.expectedFailure

@nicholascar
Copy link
Member

These test should maybe be committed with @unittest.expectedFailure

We do need a standard way of adding tests for un-solved issues but can't afford for them to fail so this does look like a solution! I'll try and add this to the PR.

@aucampia if we start to add lots of tests annotated like this, is there a way to find all those tests in the future? I don't know of a unittest tool to find such tests. Would we just have to full text search all files in test/ to find them?

@aucampia
Copy link
Member

@aucampia if we start to add lots of tests annotated like this, is there a way to find all those tests in the future? I don't know of a unittest tool to find such tests. Would we just have to full text search all files in test/ to find them?

If I run the unit tests directly with unittest they get reported as

$ poetry run python test/test_literal.py 
.........../home/iwana/d/github.com/iafork/rdflib/rdflib/term.py:1410: UserWarning: Parsing weird boolean, 'abcd' does not map to True or False
  category=UserWarning,
/home/iwana/d/github.com/iafork/rdflib/rdflib/term.py:1410: UserWarning: Parsing weird boolean, '10' does not map to True or False
  category=UserWarning,
.......x
----------------------------------------------------------------------
Ran 19 tests in 0.008s

OK (expected failures=1)

Though sadly when running with nose they don't get reported in a special way.

I think there may be more reporting options but I would have to look into it more.

@nicholascar
Copy link
Member

Rerunning tests as this should pass due to fix mentioned above.

@nicholascar
Copy link
Member

Open/Close retest

@nicholascar nicholascar reopened this May 16, 2021
This test was created before the need to decode graph serialization results was removed, so just updating for that. Now it should pass
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 75.698% when pulling 388e472 on TOMOTON:master into 7a53c61 on RDFLib:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 75.698% when pulling 388e472 on TOMOTON:master into 7a53c61 on RDFLib:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 75.698% when pulling 388e472 on TOMOTON:master into 7a53c61 on RDFLib:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 75.698% when pulling 388e472 on TOMOTON:master into 7a53c61 on RDFLib:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 75.698% when pulling 388e472 on TOMOTON:master into 7a53c61 on RDFLib:master.

@coveralls
Copy link

coveralls commented May 16, 2021

Coverage Status

Coverage increased (+0.3%) to 75.705% when pulling 388e472 on TOMOTON:master into 7a53c61 on RDFLib:master.

@nicholascar nicholascar merged commit 58b23fd into RDFLib:master May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serialization shows only partial substitution of namespace.
5 participants