Closed blaggacao closed 5 years ago
@etobella Also a policy cached policy property would be interesting:
Note: removal of the PolicyId
class was indicated as it's only method accessed an undefined property (self.identifier
) indicating the normalized form would be moving that method to the special implementation of PolicyId
class: the GenericPolicyId
class. (despite the naming which suggested an inverse relationship)
@etobella Test failure is due to a failed URL handshake when trying to query the policy, therefore unrelated to those changes.
@blaggacao Tests have been fixed. I relaunched travis in order to check that everything is right
You need to rebase in order to check that everything is fine. Could you please?
@etobella Ok, thank you so much! Let's see how it goes. I included a couple of other fixes/improvements as I'm using my fork now for development purpose, If you don't agree with anything, please kindly ask me to extract a commit into a separate PR.
Merging #4 into master will decrease coverage by
3.02%
. The diff coverage is81.15%
.
@@ Coverage Diff @@
## master #4 +/- ##
==========================================
- Coverage 95.81% 92.78% -3.03%
==========================================
Files 8 8
Lines 311 319 +8
Branches 46 44 -2
==========================================
- Hits 298 296 -2
- Misses 7 15 +8
- Partials 6 8 +2
Impacted Files | Coverage Δ | |
---|---|---|
src/xades/xades_context.py | 97.1% <100%> (ø) |
:arrow_up: |
src/xades/policy.py | 84.55% <80%> (-7.63%) |
:arrow_down: |
@etobella
As for codecov it looks like the unspecific implementation of validate_policy_node
which does not depend on initialized value (no policy cache) would not be tested with the current adaptions.
I construed a use case of something like:
Policy
class to verify it anyways (though not optimized).Policy
class.How should I adapt?
Remove it from policy (only a pass) and keep it on the Generic, I think it is the best approach.
By the way, I didn't know the usage of ElementMaker
, really interesting :smile:
@etobella Thanks for your input. Please see the latest commit, I chose NotImplementedError
instead. Also naming the Policy
class BasePolicy
better reveals it's character and role. I hope you're fine with it.
Merging it, I will not create a new version until we finish the issues you commented #7 #6
Perfect, I'll retake shortly, had another priority issue coming in...
It commonly occurs that policy resolution does not involve http, eg. in case of local caching. This commit introduces a hook to implement custom resolvers. It also polishes naming as required by this implementation.