blob: e9f9c823868966ef658e0b0ff84bfb64fbb9d9c9 [file] [log] [blame]
donNewtonAlphab8f30752018-10-04 11:57:41 -04001/*
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
17package tosca_test
18
19import (
20 "testing"
21
22 "gerrit.opencord.org/abstract-olt/models/tosca"
23)
24
25var deleteExpected = `tosca_definitions_version: tosca_simple_yaml_1_0
26imports:
27- custom_types/onudevice.yaml
28description: Delete an ont
29topology_template:
30 node_templates:
31 device#onu:
32 type: tosca.nodes.ONUDevice
33 properties:
34 serial_number: some_serial
35`
36var ontToDelete tosca.OntDelete
37
38//func NewOntProvision(serialNumber string, oltIP net.IP, ponPortNumber int) OntProvision {
39
40func 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}