donNewtonAlpha | b8f3075 | 2018-10-04 11:57:41 -0400 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2017 the original author or authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package tosca_test |
| 18 | |
| 19 | import ( |
| 20 | "testing" |
| 21 | |
| 22 | "gerrit.opencord.org/abstract-olt/models/tosca" |
| 23 | ) |
| 24 | |
| 25 | var deleteExpected = `tosca_definitions_version: tosca_simple_yaml_1_0 |
| 26 | imports: |
| 27 | - custom_types/onudevice.yaml |
| 28 | description: Delete an ont |
| 29 | topology_template: |
| 30 | node_templates: |
| 31 | device#onu: |
| 32 | type: tosca.nodes.ONUDevice |
| 33 | properties: |
| 34 | serial_number: some_serial |
| 35 | ` |
| 36 | var ontToDelete tosca.OntDelete |
| 37 | |
| 38 | //func NewOntProvision(serialNumber string, oltIP net.IP, ponPortNumber int) OntProvision { |
| 39 | |
| 40 | func TestOntDelete_NewOntDelete(t *testing.T) { |
| 41 | ontToDelete = tosca.NewOntDelete("some_serial") |
| 42 | ontYaml, _ := ontToDelete.ToYaml() |
| 43 | if ontYaml != deleteExpected { |
| 44 | t.Fatalf("Didn't generate the expected yaml\n Generated:\n%s \nExpected:\n%s\n", ontYaml, deleteExpected) |
| 45 | } |
| 46 | } |