github.com/artpar/rclone@v1.67.3/backend/jottacloud/api/types_test.go (about)

     1  package api
     2  
     3  import (
     4  	"encoding/xml"
     5  	"testing"
     6  	"time"
     7  )
     8  
     9  func TestMountpointEmptyModificationTime(t *testing.T) {
    10  	mountpoint := `
    11  <mountPoint time="2018-08-12-T09:58:24Z" host="dn-157">
    12    <name xml:space="preserve">Sync</name>
    13    <path xml:space="preserve">/foo/Jotta</path>
    14    <abspath xml:space="preserve">/foo/Jotta</abspath>
    15    <size>0</size>
    16    <modified></modified>
    17    <device>Jotta</device>
    18    <user>foo</user>
    19    <metadata first="" max="" total="0" num_folders="0" num_files="0"/>
    20  </mountPoint>
    21  `
    22  	var jf JottaFolder
    23  	if err := xml.Unmarshal([]byte(mountpoint), &jf); err != nil {
    24  		t.Fatal(err)
    25  	}
    26  	if !time.Time(jf.ModifiedAt).IsZero() {
    27  		t.Errorf("got non-zero time, want zero")
    28  	}
    29  }