Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TRIQS/solid_dmft
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a8d42395eff9c767fa60290fa370e4fa7fdeadb2
Choose a base ref
..
head repository: TRIQS/solid_dmft
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6ff7971425638703ec05bc4d29e7056c7c70627d
Choose a head ref
Showing with 7 additions and 9 deletions.
  1. +7 −8 test/python/test_postproc_toml_dict.py
  2. +0 −1 test/python/test_postproc_toml_dict_integration.py
15 changes: 7 additions & 8 deletions test/python/test_postproc_toml_dict.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
from solid_dmft.io_tools.postproc_toml_dict import merge_config_with_default, _apply_default_values, _verify_restrictions_on_default_and_config, _resolve_references

import unittest
@@ -14,7 +13,7 @@ def test_verify_restrictions_invalid_section(self):
'section2': {'key1': 'defval21', 'key2': 'defval22', 'key3': 'defval23'},
'section3': {'key1': 'defval31', 'key2': 'defval32', 'key3': 'defval33'},
}
with pytest.raises(ValueError):
with self.assertRaises(ValueError):
_verify_restrictions_on_default_and_config(config, default, {})

def test_verify_restrictions_key_outside_section_default(self):
@@ -28,7 +27,7 @@ def test_verify_restrictions_key_outside_section_default(self):
'section3': {'key1': 'defval31', 'key2': 'defval32', 'key3': 'defval33'},
'invalid_key': 'value',
}
with pytest.raises(ValueError):
with self.assertRaises(ValueError):
_verify_restrictions_on_default_and_config(config, default, {})

def test_verify_restrictions_key_outside_section_config(self):
@@ -41,7 +40,7 @@ def test_verify_restrictions_key_outside_section_config(self):
'section2': {'key1': 'defval21', 'key2': 'defval22', 'key3': 'defval23'},
'section3': {'key1': 'defval31', 'key2': 'defval32', 'key3': 'defval33'},
}
with pytest.raises(ValueError):
with self.assertRaises(ValueError):
_verify_restrictions_on_default_and_config(config, default, {})

def test_verify_restriction_missing_listed_section(self):
@@ -52,7 +51,7 @@ def test_verify_restriction_missing_listed_section(self):
'section3': {'key1': 'defval31', 'key2': 'defval32', 'key3': 'defval33'},
}

with pytest.raises(ValueError):
with self.assertRaises(ValueError):
_verify_restrictions_on_default_and_config(default, config, {'section1': 'match'})

def test_merge_config_nonexistent_listed_section(self):
@@ -65,7 +64,7 @@ def test_merge_config_nonexistent_listed_section(self):
'section2': {'key1': 'defval21', 'key2': 'defval22', 'key3': 'defval23'},
'section3': {'key1': 'defval31', 'key2': 'defval32', 'key3': 'defval33'},
}
with pytest.raises(ValueError):
with self.assertRaises(ValueError):
merge_config_with_default(config, default, {})

def test_resolve_references_simple(self):
@@ -89,7 +88,7 @@ def test_resolve_references_chained_reference(self):
'section2': {'key1': 'defval21', 'key2': 'defval22', 'key3': '<section3.key3>'},
'section3': {'key1': 'defval31', 'key2': 'defval32', 'key3': 'defval33'},
}
with pytest.raises(ValueError):
with self.assertRaises(ValueError):
_resolve_references(config['section1'], 'section1', config)

def test_apply_default_values_partial_config(self):
@@ -151,7 +150,7 @@ def test_apply_default_values_invalid_key(self):
'section2': {'key1': 'defval21', 'key2': 'defval22', 'key3': 'defval23'},
'section3': {'key1': 'defval31', 'key2': 'defval32', 'key3': 'defval33'},
}
with pytest.raises(ValueError):
with self.assertRaises(ValueError):
_apply_default_values(config, default, {})

def test_apply_default_values_invalid_listed_key(self):
1 change: 0 additions & 1 deletion test/python/test_postproc_toml_dict_integration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
from solid_dmft.io_tools.postproc_toml_dict import merge_config_with_default

import unittest