Skip to content

Commit

Permalink
🎉 Bump version to v1.0.0 (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolflu05 authored Aug 2, 2023
1 parent 8c40fde commit e01f1c1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function BulkDefinitionSchemaBuilder({ schema, setSchema, generateKeys = {} }) {
useEffect(() => {
if (schema === null) {
setSchema({
version: "0.1.0",
version: "1.0.0",
input: {},
templates: [],
output: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_validate_template(self):
validate_template(schema)

valid_schema = json.dumps({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -53,7 +53,7 @@ def setUp(self):
super().setUp()

self.simple_valid_generation_template = {
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -66,7 +66,7 @@ def setUp(self):
self.simple_valid_generation_template_json = json.dumps(self.simple_valid_generation_template)

self.complex_valid_generation_template = {
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand Down Expand Up @@ -130,7 +130,7 @@ def test_url_parse(self):

# There should be a 400 on invalid user input - invalid generation template
data = {
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -149,7 +149,7 @@ def test_url_parse(self):

# If template_type is provided and exists, everything should work
data = {
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand Down Expand Up @@ -189,7 +189,7 @@ def url(pk):

# generation without name should raise an error
schema = {
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {"generate": {"description": "Test description"}}
Expand Down
2 changes: 1 addition & 1 deletion inventree_bulk_plugin/tests/integration/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def prepare(self):
bulk_creation_template = self.old_state.apps.get_model('inventree_bulk_plugin', 'bulkCreationTemplate')

simple_valid_generation_template = {
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand Down
38 changes: 19 additions & 19 deletions inventree_bulk_plugin/tests/unit/test_BulkGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_1D_generation(self):
for dim, exp in dimensions:
with self.subTest(f"test {dim} dimension"):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -34,7 +34,7 @@ def test_1D_generation(self):

def test_template(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [
{
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_apply_template(self):
def test_reference_undefined_template(self):
with self.assertRaisesRegex(ValueError, "template Drawer is not defined"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -116,7 +116,7 @@ def test_reference_undefined_template(self):

def test_without_dimensions(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -135,7 +135,7 @@ def test_without_dimensions(self):

def test_input_variables(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {"a": "2", "b": "Hello"},
"templates": [],
"output": {
Expand All @@ -157,7 +157,7 @@ def test_input_variables(self):
def test_invalid_template(self):
with self.assertRaisesRegex(Exception, "1 validation error for BulkDefinitionSchema\noutput\n output.dimensions.0: 'hello' is undefined"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -180,7 +180,7 @@ def test_invalid_template_on_dimensions_render(self):
with self.subTest(name, template=template):
with self.assertRaisesRegex(error, error_regex):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -195,7 +195,7 @@ def test_invalid_template_on_dimensions_render(self):

def test_merge_base_child_to_childs(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -217,7 +217,7 @@ def test_merge_base_child_to_childs(self):

def test_merge_base_child_to_childs_with_no_childs(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -237,7 +237,7 @@ def test_merge_base_child_to_childs_with_no_childs(self):

def test_parent_name_match(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -264,7 +264,7 @@ def test_parent_name_match(self):
def test_missing_child_match(self):
with self.assertRaisesRegex(ValueError, "No match for 1"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -283,7 +283,7 @@ def test_missing_child_match(self):
def test_error_in_parent_name_match(self):
with self.assertRaisesRegex(ValueError, "Invalid generator template '{{something.not.existing}}'"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -301,7 +301,7 @@ def test_error_in_parent_name_match(self):

def test_parent_context(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -321,7 +321,7 @@ def test_parent_context(self):

def test_len_context_variable(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {
Expand All @@ -340,15 +340,15 @@ def test_len_context_variable(self):
def test_not_allowed_field(self):
with self.assertRaisesRegex(ValueError, "'NOT_ALLOWED_KEY' is not allowed to be generated"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {"generate": {"NOT_ALLOWED_KEY": "1"}, }
}, {"BBBB": {}}).generate()

def test_cast_field(self):
res = BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {"generate": {"number_field": "42"}, }
Expand All @@ -359,23 +359,23 @@ def test_cast_field(self):
def test_required_field(self):
with self.assertRaisesRegex(ValueError, "'required_field' is a required field, but template returned empty string"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {"generate": {"required_field": ""}, }
}, {"required_field": {"required": True}}).generate()

with self.assertRaisesRegex(ValueError, "'name' is missing in generated keys"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {"generate": {"description": ""}, }
}, {"name": {"required": True}}).generate()

with self.assertRaisesRegex(ValueError, "'name' is a required field, but template returned empty string"):
BulkGenerator({
"version": "0.1.0",
"version": "1.0.0",
"input": {},
"templates": [],
"output": {"generate": {"name": "", "description": "AA"}, }
Expand Down
2 changes: 1 addition & 1 deletion inventree_bulk_plugin/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BULK_PLUGIN_VERSION = "0.1.0"
BULK_PLUGIN_VERSION = "1.0.0"

0 comments on commit e01f1c1

Please sign in to comment.